diff --git a/CHANGELOG.md b/CHANGELOG.md index f996329..9838fd8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Next version - add timeout for creating ws connections +- fix config file not reloading when restarting bots ## 1.1.2 (2019-04-14) diff --git a/yaboli/__init__.py b/yaboli/__init__.py index b138c88..241bf0e 100644 --- a/yaboli/__init__.py +++ b/yaboli/__init__.py @@ -54,12 +54,12 @@ def run( bot_constructor: BotConstructor, config_file: str = "bot.conf", ) -> None: - # Load the config file - config = configparser.ConfigParser(allow_no_value=True) - config.read(config_file) - async def _run() -> None: while True: + # Load the config file + config = configparser.ConfigParser(allow_no_value=True) + config.read(config_file) + bot = bot_constructor(config, config_file) await bot.run() @@ -70,12 +70,12 @@ def run_modulebot( module_constructors: Dict[str, ModuleConstructor], config_file: str = "bot.conf", ) -> None: - # Load the config file - config = configparser.ConfigParser(allow_no_value=True) - config.read(config_file) - async def _run() -> None: while True: + # Load the config file + config = configparser.ConfigParser(allow_no_value=True) + config.read(config_file) + modulebot = modulebot_constructor(config, config_file, module_constructors) await modulebot.run()