mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-05 17:02:32 -05:00
Owners can bypass cooldowns with non persistent toggle (#4440)
* dev bypas cooldowns * Toggleable within dev, new attrib * Reuqested changes * Remake content * Looks like `reset_cooldown()` is under Command object :) * Remove `await` Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
This commit is contained in:
@@ -292,6 +292,11 @@ def init_events(bot, cli_flags):
|
||||
elif isinstance(error, commands.CheckFailure):
|
||||
pass
|
||||
elif isinstance(error, commands.CommandOnCooldown):
|
||||
if bot._bypass_cooldowns and ctx.author.id in bot.owner_ids:
|
||||
ctx.command.reset_cooldown(ctx)
|
||||
new_ctx = await bot.get_context(ctx.message)
|
||||
await bot.invoke(new_ctx)
|
||||
return
|
||||
if delay := humanize_timedelta(seconds=error.retry_after):
|
||||
msg = _("This command is on cooldown. Try again in {delay}.").format(delay=delay)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user