From bb61c5c6c9381a8142f609b6b42bf62b4b11e2bf Mon Sep 17 00:00:00 2001 From: sgoudham Date: Sun, 19 Jul 2020 04:38:45 +0100 Subject: [PATCH] Adding commentary Error message is now deleted after 5 seconds instead of 2.5 --- main.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/main.py b/main.py index 54731f1f..ef595188 100644 --- a/main.py +++ b/main.py @@ -202,13 +202,13 @@ async def on_command_error(ctx, args2): await on_command_not_found(ctx) -# Async def for handling cooldown error/permission errors +# Async def for handling command not found error async def on_command_not_found(ctx): - # Send an error message to the user telling them that the command is on cooldown + # Send an error message to the user telling them that the command doesn't exist message = await ctx.send(f'**Command Not Found! Please use `{ctx.prefix}help` to see all commands**') - # Let the User read the message for 2.5 seconds - await asyncio.sleep(2.5) + # Let the User read the message for 5 seconds + await asyncio.sleep(5) # Delete the message await message.delete() @@ -218,8 +218,8 @@ async def on_command_cooldown(ctx, error): # Send an error message to the user telling them that the command is on cooldown message = await ctx.send(f'That command is on cooldown. Try again in **{error.retry_after:,.2f}** seconds.') - # Let the User read the message for 2.5 seconds - await asyncio.sleep(2.5) + # Let the User read the message for 5 seconds + await asyncio.sleep(5) # Delete the message await message.delete() @@ -229,8 +229,8 @@ async def on_command_permission(ctx): # Send an error message to the user saying that they don't have permission to use this command message = await ctx.send("**Uh oh! You don't have permission to use this command!**") - # Let the user read the message for 2.5 seconds - await asyncio.sleep(2.5) + # Let the user read the message for 5 seconds + await asyncio.sleep(5) # Delete the message await message.delete() @@ -239,8 +239,8 @@ async def on_command_missing_user(ctx): # Send an error message to the user saying that an argument is missing message = await ctx.send("**Uh oh! Couldn't find anyone to mention! Try again!**") - # Let the user read the message for 2.5 seconds - await asyncio.sleep(2.5) + # Let the user read the message for 5 seconds + await asyncio.sleep(5) # Delete the message await message.delete()