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: