Answer the question
In order to leave comments, you need to log in
How to make a cooldown alert?
Hello!
Tell me please. I have a cooldown command how to make a cooldown alert?
Team:
@client.command()
@commands.cooldown(1, 5, commands.BucketType.user)
async def helpserv(ctx):
await ctx.send('Hello')
Answer the question
In order to leave comments, you need to log in
https://discordpy.readthedocs.io/en/stable/ext/com...
https://discordpy.readthedocs.io/en/stable/ext/com...
@bot.listener()
async def on_command_error(ctx, error):
if isinstance(error, commands.CommandOnCooldown):
await ctx.send(
f"Эту команду можно использовать {error.cooldown.rate} раз в "
f"{error.cooldown.per} секунд на {error.cooldown.type}."
f"Попробуйте еще раз через {error.retry_after} секунд."
)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question