Added prefix as init argument

master
Jef Roosens 2020-08-25 19:11:45 +02:00
parent 92d19c0ccd
commit cccdd667fb
1 changed files with 5 additions and 4 deletions

View File

@ -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)