Respect [p]bypasscooldowns in [p]slash sync (#6465)

This commit is contained in:
Michael Oliveira 2024-12-23 21:04:11 -05:00 committed by GitHub
parent 016684bcce
commit 18614b1604
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2375,6 +2375,11 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic):
"""Custom cooldown error message.""" """Custom cooldown error message."""
if not isinstance(error, commands.CommandOnCooldown): if not isinstance(error, commands.CommandOnCooldown):
return await ctx.bot.on_command_error(ctx, error, unhandled_by_cog=True) return await ctx.bot.on_command_error(ctx, error, unhandled_by_cog=True)
if ctx.bot._bypass_cooldowns and ctx.author.id in ctx.bot.owner_ids:
ctx.command.reset_cooldown(ctx)
new_ctx = await ctx.bot.get_context(ctx.message)
await ctx.bot.invoke(new_ctx)
return
await ctx.send( await ctx.send(
_( _(
"You seem to be attempting to sync after recently syncing. Discord does not like it " "You seem to be attempting to sync after recently syncing. Discord does not like it "