diff options
author | 2020-05-19 09:50:32 +0300 | |
---|---|---|
committer | 2020-05-19 09:50:32 +0300 | |
commit | e950deff01e633eb899da2a915cb5bff8e43e4c5 (patch) | |
tree | 64a4a32ee6e5a68dc8c14aa87144a4514028b691 | |
parent | EH Tests: Created test for `handle_user_input_error` `get_help_command` (diff) |
Error Handler: Changed way of help command get + send to avoid warning
Only get coroutine when this is gonna be awaited.
-rw-r--r-- | bot/cogs/error_handler.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/bot/cogs/error_handler.py b/bot/cogs/error_handler.py index 65cf5e37b..a70ebe109 100644 --- a/bot/cogs/error_handler.py +++ b/bot/cogs/error_handler.py @@ -159,19 +159,17 @@ class ErrorHandler(Cog): * ArgumentParsingError: send an error message * Other: send an error message and the help command """ - prepared_help_command = self.get_help_command(ctx) - if isinstance(e, errors.MissingRequiredArgument): await ctx.send(f"Missing required argument `{e.param.name}`.") - await prepared_help_command + await self.get_help_command(ctx) self.bot.stats.incr("errors.missing_required_argument") elif isinstance(e, errors.TooManyArguments): await ctx.send(f"Too many arguments provided.") - await prepared_help_command + await self.get_help_command(ctx) self.bot.stats.incr("errors.too_many_arguments") elif isinstance(e, errors.BadArgument): await ctx.send(f"Bad argument: {e}\n") - await prepared_help_command + await self.get_help_command(ctx) self.bot.stats.incr("errors.bad_argument") elif isinstance(e, errors.BadUnionArgument): await ctx.send(f"Bad argument: {e}\n```{e.errors[-1]}```") @@ -181,7 +179,7 @@ class ErrorHandler(Cog): self.bot.stats.incr("errors.argument_parsing_error") else: await ctx.send("Something about your input seems off. Check the arguments:") - await prepared_help_command + await self.get_help_command(ctx) self.bot.stats.incr("errors.other_user_input_error") @staticmethod |