Bot self deletion error commands

testing
sgoudham 5 years ago
parent 009688fb2e
commit 97402602a0

@ -162,10 +162,12 @@ async def kakashi(ctx):
@client.event @client.event
async def on_command_error(ctx, error): async def on_command_error(ctx, error):
if isinstance(error, commands.CommandOnCooldown): if isinstance(error, commands.CommandOnCooldown):
await ctx.send(f'That command is on cooldown. Try again in {error.retry_after:,.2f} seconds.') message = await ctx.send(f'That command is on cooldown. Try again in {error.retry_after:,.2f} seconds.')
await asyncio.sleep(3)
#Let the user read the message for 1.5 seconds
await asyncio.sleep(1.5)
## delete the message ## delete the message
await ctx.delete() await message.delete()
client.run('NzE2NzAxNjk5MTQ1NzI4MDk0.XtWFiw.KZrh9Tkp9vTY9JYSgZfpg2P4mlQ') client.run('NzE2NzAxNjk5MTQ1NzI4MDk0.XtWFiw.KZrh9Tkp9vTY9JYSgZfpg2P4mlQ')

Loading…
Cancel
Save