Moved error handling to the main program EnsoBot.py

pull/1/head
sgoudham 5 years ago
parent e17d048d68
commit 1778f2def1

@ -46,6 +46,17 @@ async def on_command_error(ctx, error):
await message.delete() await message.delete()
@client.event
async def on_command_error(ctx, target: discord.member):
if isinstance(target, commands.MissingRequiredArgument):
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(1.5)
# Delete the message
await message.delete()
try: try:
client.run(API_TOKEN) client.run(API_TOKEN)
except discord.errors.LoginFailure as e: except discord.errors.LoginFailure as e:

Loading…
Cancel
Save