Catching CommandOnCooldown Error
问题 I am making a discord bot that has a cooldown and I am attempting to make an event that when the CommandOnCooldown Error occurs, the bot will DM them how much longer they have to wait. Here is my code and it all looks okay, but it doesn't know what retry_after means: @bot.event async def on_CommandOnCooldown(): await bot.send_message(ctx.message.channel, 'You are on cooldown. Try again in {:.2f}s'.format(retry_after)) @bot.command(pass_context = True) @commands.cooldown(1, 30, commands