From eed030b573d72769363c3c7e1d48160dde7cffcd Mon Sep 17 00:00:00 2001 From: Parker Date: Wed, 26 Jun 2024 18:29:16 -0500 Subject: [PATCH] Skip loading feedback/bug cog(s) if no ID given --- code/bot.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/code/bot.py b/code/bot.py index 2e3123f..7da4f07 100644 --- a/code/bot.py +++ b/code/bot.py @@ -16,8 +16,15 @@ class MyBot(commands.Bot): async def setup_hook(self): get_access_token.start() + config.LOG.info("Loading cogs...") for ext in os.listdir("./code/cogs"): if ext.endswith(".py"): + if ext[:-3] == "feedback" and config.FEEDBACK_CHANNEL_ID == None: + config.LOG.info("Skipped loading feedback cog - channel ID not provided") + continue + if ext[:-3] == "bug" and config.BUG_CHANNEL_ID == None: + config.LOG.info("Skipped loading bug cog - channel ID not provided") + continue await self.load_extension(f"cogs.{ext[:-3]}") for ext in os.listdir("./code/cogs/owner"): if ext.endswith(".py"): @@ -33,6 +40,7 @@ bot.autoplay = [] # guild_id, guild_id, etc. @bot.event async def on_ready(): config.LOG.info(f"{bot.user} has connected to Discord.") + config.LOG.info("Startup complete. Sync slash commands by DMing the bot ***sync") @tasks.loop(minutes=45)