From 0df85baa70839ebdaeeb1dd3946499cab41c0ab1 Mon Sep 17 00:00:00 2001 From: Leander Furumo Date: Sat, 24 Oct 2026 03:37:20 +0200 Subject: [PATCH] fix non slash command cooldowns mistriggering --- src/cogs/errors.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/cogs/errors.py b/src/cogs/errors.py index 1754da8..a6152a1 100644 --- a/src/cogs/errors.py +++ b/src/cogs/errors.py @@ -66,11 +66,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 + # Let the user retry a command that failed without waiting for its cooldown. + # Don't reset it when the error is the cooldown itself, as that would make every other attempt bypass it + 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"):