From cccdd667fb6475fc0bfa1fa83957529257234ad4 Mon Sep 17 00:00:00 2001 From: chewingbever Date: Tue, 25 Aug 2020 19:11:45 +0200 Subject: [PATCH] Added prefix as init argument --- frank/frank.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/frank/frank.py b/frank/frank.py index 516e509..90fbe6f 100644 --- a/frank/frank.py +++ b/frank/frank.py @@ -23,20 +23,21 @@ class Frank(discord.Client): their own behavior. """ - PREFIX = 'fr' - """Prefix to use Frank inside Discord.""" - - def __init__(self, modules: List[Module], config_file: str = 'frank.yaml'): + def __init__(self, modules: List[Module], config_file: str = 'frank.yaml', + prefix: str = 'fr'): """ Args: modules: modules to load config_file: path to yaml config file; ignored if non-existent + prefix: prefix to activate Frank in the Discord server """ super().__init__() self._modules = modules self._loaded_modules = [] + self.PREFIX = prefix + try: with open(config_file, 'r') as f: self._config = yaml.load(f, Loader=yaml.FullLoader)