1
0
Fork 0
mirror of https://github.com/myned/modufur.git synced 2024-12-24 14:27:27 +00:00

Add MissingRequiredArgument and BadArgument to on_command_error

This commit is contained in:
Myned 2018-01-14 01:26:13 -05:00
parent b433ea6273
commit 1c1ecf9d6b

View file

@ -143,6 +143,12 @@ async def on_error(error, *args, **kwargs):
async def on_command_error(ctx, error): async def on_command_error(ctx, error):
if isinstance(error, err.NotFound): if isinstance(error, err.NotFound):
print('NOT FOUND') print('NOT FOUND')
elif isinstance(error, errext.MissingRequiredArgument):
await ctx.send('**Missing required argument**', delete_after=7)
await ctx.message.add_reaction('\N{CROSS MARK}')
elif isinstance(error, errext.BadArgument):
await ctx.send(f'**Invalid argument.** {error}', delete_after=7)
await ctx.message.add_reaction('\N{CROSS MARK}')
elif isinstance(error, errext.CheckFailure): elif isinstance(error, errext.CheckFailure):
await ctx.send('**Insufficient permissions**', delete_after=7) await ctx.send('**Insufficient permissions**', delete_after=7)
await ctx.message.add_reaction('\N{NO ENTRY}') await ctx.message.add_reaction('\N{NO ENTRY}')