From 7eaf6f1d0fc752552ed6aa51aa79680cbaccdc21 Mon Sep 17 00:00:00 2001 From: Leander Furumo Date: Fri, 23 Oct 2026 21:36:05 +0200 Subject: [PATCH] stop resetting the cooldown when the error is the cooldown itself Co-Authored-By: Claude Opus 5.5 --- bot/src/cogs/errors.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/bot/src/cogs/errors.py b/bot/src/cogs/errors.py index a943987..e208cd9 100644 --- a/bot/src/cogs/errors.py +++ b/bot/src/cogs/errors.py @@ -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"):