diff options
| author | 2020-02-16 13:15:55 -0800 | |
|---|---|---|
| committer | 2020-02-16 13:16:39 -0800 | |
| commit | d2f94f4c1280716e32e13611f6c778f9d9d4efd3 (patch) | |
| tree | 995951708e3d4df725c79dc35b1cc8e03228d8ff | |
| parent | Error handler: simplify error imports (diff) | |
Error handler: handle MissingRequiredArgument
Send a message indicating which argument is missing.
Diffstat (limited to '')
| -rw-r--r-- | bot/cogs/error_handler.py | 5 | 
1 files changed, 4 insertions, 1 deletions
| diff --git a/bot/cogs/error_handler.py b/bot/cogs/error_handler.py index c65ada344..ffb36d10a 100644 --- a/bot/cogs/error_handler.py +++ b/bot/cogs/error_handler.py @@ -113,7 +113,10 @@ class ErrorHandler(Cog):          # TODO: use ctx.send_help() once PR #519 is merged.          help_command = await self.get_help_command(ctx.command) -        if isinstance(e, errors.BadArgument): +        if isinstance(e, errors.MissingRequiredArgument): +            await ctx.send(f"Missing required argument `{e.param.name}`.") +            await ctx.invoke(*help_command) +        elif isinstance(e, errors.BadArgument):              await ctx.send(f"Bad argument: {e}\n")              await ctx.invoke(*help_command)          else: | 
