From 1c1ecf9d6b0516f66dd5715c95f9a84acea51b7b Mon Sep 17 00:00:00 2001 From: Myned Date: Sun, 14 Jan 2018 01:26:13 -0500 Subject: [PATCH] Add MissingRequiredArgument and BadArgument to on_command_error --- src/run.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/run.py b/src/run.py index 45de512..1d72368 100644 --- a/src/run.py +++ b/src/run.py @@ -143,6 +143,12 @@ async def on_error(error, *args, **kwargs): async def on_command_error(ctx, error): if isinstance(error, err.NotFound): 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): await ctx.send('**Insufficient permissions**', delete_after=7) await ctx.message.add_reaction('\N{NO ENTRY}')