Fix: ignore CommandNotFound errors in on_command_error (e.g. git reset --hard origin/main)
This commit is contained in:
parent
9974a2b6b3
commit
8d15d05c3d
1 changed files with 2 additions and 0 deletions
2
bot.py
2
bot.py
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue