Fix: ignore CommandNotFound errors in on_command_error (e.g. git reset --hard origin/main)

This commit is contained in:
Mathis 2026-03-10 22:12:55 +01:00
parent 9974a2b6b3
commit 8d15d05c3d

2
bot.py
View file

@ -213,6 +213,8 @@ class MyBot(commands.Bot):
self.advanced_logger.log_voice_event(member, after.channel, "moved_to")
async def on_command_error(self, ctx, error):
if isinstance(error, commands.CommandNotFound):
return # Ignorer les erreurs "Command not found" pour éviter de polluer les logs (ex: !!)
if isinstance(error, commands.CheckFailure):
return # Déjà géré dans le whitelist_check
kuby_logger.error(f"Command error in {ctx.command}: {str(error)}", exc_info=True)