From 7a64e334d20d17c484644351fe46e0cc451c008a Mon Sep 17 00:00:00 2001 From: kku Date: Fri, 27 Dec 2024 20:42:12 +0100 Subject: [PATCH] Added logging for thread creation message deletion --- cogs/logger.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/cogs/logger.py b/cogs/logger.py index e16997a..54201e2 100644 --- a/cogs/logger.py +++ b/cogs/logger.py @@ -43,7 +43,18 @@ class Logger(commands.Cog): > 0 ) ): - await message.delete() + try: + logger.info( + "Deleting the thread creation message in a custom channel %s", + message.channel.id, + ) + await message.delete() + except Exception as exc: + logger.warning( + "Could not delete the thread creation message in a custom channel %s due to %s", + message.channel.id, + exc, + ) @commands.Cog.listener() async def on_member_join(self, member: Member) -> None: