forked from HoloTech/subathon-tracker-bot
tweak(bot): Don't error from non-existent commands
This commit is contained in:
@@ -197,3 +197,9 @@ class Bot(commands.Bot):
|
|||||||
await self.add_token(row.token, row.refresh_token)
|
await self.add_token(row.token, row.refresh_token)
|
||||||
except Exception:
|
except Exception:
|
||||||
logger.exception(f"Failed to add token for {row}")
|
logger.exception(f"Failed to add token for {row}")
|
||||||
|
|
||||||
|
async def event_command_error(self, payload: commands.CommandErrorPayload) -> None:
|
||||||
|
if isinstance(payload.exception, commands.CommandNotFound):
|
||||||
|
logger.debug(f"Attempt to execute nonexistent command for context {payload.context!r}")
|
||||||
|
else:
|
||||||
|
return await super().event_command_error(payload)
|
||||||
|
|||||||
Reference in New Issue
Block a user