aboutsummaryrefslogtreecommitdiff
path: root/code/bot.py
diff options
context:
space:
mode:
authorParker <contact@pkrm.dev>2024-06-26 18:29:16 -0500
committerParker <contact@pkrm.dev>2024-06-26 18:29:16 -0500
commiteed030b573d72769363c3c7e1d48160dde7cffcd (patch)
tree9e559f4678d1334c03a9d57101cace20bd39d4b2 /code/bot.py
parentcb6d68140c6829af75c375140318bc067d6b3cc7 (diff)
Skip loading feedback/bug cog(s) if no ID given
Diffstat (limited to 'code/bot.py')
-rw-r--r--code/bot.py8
1 files changed, 8 insertions, 0 deletions
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)