From bf43eef32d37df826c8dd0cf418bf73a13c831f5 Mon Sep 17 00:00:00 2001 From: Arthurdw Date: Sat, 16 Sep 2023 17:24:14 +0200 Subject: [PATCH] :bug: Resolved bug (#7) due to api updates --- run.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/run.py b/run.py index 8ab60b4..925d267 100644 --- a/run.py +++ b/run.py @@ -71,12 +71,6 @@ def __init__(self, _p: Prettier, _ph: PrintHandler): self.ph.info("No updates found, starting bot...") self.ph.info("Started loading extensions.") - extensions = list(map(lambda extension: extension.replace(back_slash, ".")[:-3], glob("extensions/*.py"))) - - for index, _ in enumerate(self.load_extensions(extensions)): - if strtobool(cfg["CONSOLE"].get("print_imports", "true")): - self.ph.info(f"Successfully loaded " - f"{Colors.light_magenta.value + extensions[index].replace('extensions.', '')}") @staticmethod def restart(): @@ -93,6 +87,20 @@ def check_for_updates(self): self.restart() async def on_ready(self): + from extensions.ReactionLogger import ReactionLogger + from extensions.ReactionRoles import ReactionRoles + + extensions = [ReactionRoles] + + if strtobool(cfg["REACTION_LOGGING"].get("enabled", "true")): + extensions.append(ReactionLogger) + + for index, extension in enumerate(extensions): + await self.add_cog(extension(self)) + if strtobool(cfg["CONSOLE"].get("print_imports", "true")): + self.ph.info(f"Successfully loaded " + f"{Colors.light_magenta.value + extension.__name__}") + self.ph.info(f"Currently running on v{self.vm.version}!") print()