1
0
Fork 0
mirror of synced 2024-05-19 20:12:30 +12:00

Added error handling for Invalid Commands

This commit is contained in:
Phxntxm 2016-07-10 06:53:56 -05:00
parent 76db201274
commit d79ef7281c

2
bot.py
View file

@ -49,6 +49,8 @@ async def on_member_remove(member):
@bot.event
async def on_command_error(error, ctx):
if isinstance(error,discord.CommandNotFound):
await bot.send_message(ctx.message.channel,"That is not a valid command! If you need asistance on what command to use, please type '!help'")
fmt = 'An error occurred while processing this request: ```py\n{}: {}\n```'
await bot.send_message(ctx.message.channel,fmt.format(type(error).__name__, error))