stop resetting the cooldown when the error is the cooldown itself

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
leanderandClaude Opus 5.5 committed 2026-10-23 21:36:05 +02:00
1 parent d12d92a7a9
commit 7eaf6f1d0f
1 file changed
+4 -5
+4 -5
View File
@@ -65,11 +65,10 @@ class Errors(commands.Cog):
error (commands.CommandError): Eror context object
"""
# Reset cooldown if command throws AttributeError
try:
self.bot.get_command(f"{ctx.command}").reset_cooldown(ctx)
except AttributeError:
pass
# Failed commands don't count towards the cooldown, unless the failure is the cooldown itself.
# Resetting it then would let the next attempt through
if ctx.command and not isinstance(error, commands.CommandOnCooldown):
ctx.command.reset_cooldown(ctx)
# Ignore command's own error handling
if hasattr(ctx.command, "on_error"):