mirror of
https://github.com/UiO-Gaming/mustafa.git
synced 2026-11-05 13:56:48 +01:00
fix non slash command cooldowns mistriggering
This commit is contained in:
1 parent
b094219a24
commit
0df85baa70
1 file changed
+4
-5
+4
-5
@@ -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"):
|
||||
|
||||
Reference in new issue
Block a user