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

Changing the CommandNotFound error to refer to the commands class

This commit is contained in:
Phxntxm 2016-07-11 06:42:27 -05:00
parent 7de338c074
commit a7ec119011

6
bot.py
View file

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