Skip to content

Commit 85b140e

Browse files
committed
Add debug logging to category and setup command code paths
Added to help debug setup errors
1 parent 21f3136 commit 85b140e

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

bot.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,11 +432,14 @@ def using_multiple_server_setup(self) -> bool:
432432
@property
433433
def main_category(self) -> typing.Optional[discord.CategoryChannel]:
434434
if self.modmail_guild is not None:
435+
logger.debug(f"Resolving main category for guild {self.modmail_guild.name}")
435436
category_id = self.config["main_category_id"]
437+
logger.debug(f"Found main category ID in config: {category_id}")
436438
if category_id is not None:
437439
try:
438440
cat = discord.utils.get(self.modmail_guild.categories, id=int(category_id))
439441
if cat is not None:
442+
logger.debug(f"Resolved main category: {cat.id}")
440443
return cat
441444
except ValueError:
442445
pass

cogs/modmail.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ async def setup(self, ctx):
4242
return await ctx.send(f"You can only setup in the Modmail guild: {self.bot.modmail_guild}.")
4343

4444
if self.bot.main_category is not None:
45-
logger.debug("Can't re-setup server, main_category is found.")
45+
logger.warning("Can't re-setup server, main_category is found.")
46+
logger.debug(f"Current main category: {self.bot.main_category.name}")
4647
return await ctx.send(f"{self.bot.modmail_guild} is already set up.")
4748

4849
if self.bot.modmail_guild is None:

0 commit comments

Comments
 (0)