how to make a cooldown in discord.py
from discord.ext.commands import cooldown, BucketType
@commands.cooldown(1, 3, commands.BucketType.user)
@client.command()
async def command_name(ctx):
print('Eyy')
@command_name.error
async def command_name_error(ctx, error):
if isinstance(error, commands.CommandOnCooldown):
em = discord.Embed(title=f"You are in cooldown",description=f"Try again in {error.retry_after:.2f}s.", color=discord.Color.orange())
await ctx.send(embed=em)