Skip to content

Commit

Permalink
Respect [p]bypasscooldowns in [p]slash sync (#6465)
Browse files Browse the repository at this point in the history
  • Loading branch information
Flame442 authored Dec 24, 2024
1 parent 016684b commit 18614b1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions redbot/core/core_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -2375,6 +2375,11 @@ async def slash_sync_error(self, ctx: commands.Context, error: commands.CommandE
"""Custom cooldown error message."""
if not isinstance(error, commands.CommandOnCooldown):
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(
_(
"You seem to be attempting to sync after recently syncing. Discord does not like it "
Expand Down

0 comments on commit 18614b1

Please # to comment.