mirror of
https://github.com/myned/modufur.git
synced 2024-11-01 21:02:38 +00:00
Add MissingRequiredArgument and BadArgument to on_command_error
This commit is contained in:
parent
b433ea6273
commit
1c1ecf9d6b
1 changed files with 6 additions and 0 deletions
|
@ -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}')
|
||||||
|
|
Loading…
Reference in a new issue