diff options
| author | 2020-03-15 16:47:03 +0100 | |
|---|---|---|
| committer | 2020-03-15 16:47:03 +0100 | |
| commit | dc534b72fcb561c057b1584311ca9e27244f08ae (patch) | |
| tree | f8c518b8a61cf598b96b5b620c517ac721b413e4 | |
| parent | Adjust docstring styling. (diff) | |
Move coro execution outside of if condition.
This gives us a clearer look at the general flow control and what's getting executed.
Comment was also moved to its relevant line.
Co-authored-by: MarkKoz <[email protected]>
| -rw-r--r-- | bot/cogs/error_handler.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/bot/cogs/error_handler.py b/bot/cogs/error_handler.py index 7989acde7..73757b7b7 100644 --- a/bot/cogs/error_handler.py +++ b/bot/cogs/error_handler.py @@ -50,15 +50,13 @@ class ErrorHandler(Cog): log.trace(f"Command {command} had its error already handled locally; ignoring.") return - # Try to look for a tag with the command's name if the command isn't found. - if isinstance(e, errors.CommandNotFound): - if ( - not await self.try_silence(ctx) - and not hasattr(ctx, "invoked_from_error_handler") - and ctx.channel.id != Channels.verification - ): + if isinstance(e, errors.CommandNotFound) and not hasattr(ctx, "invoked_from_error_handler"): + if await self.try_silence(ctx): + return + if ctx.channel.id != Channels.verification: + # Try to look for a tag with the command's name await self.try_get_tag(ctx) - return # Exit early to avoid logging. + return # Exit early to avoid logging. elif isinstance(e, errors.UserInputError): await self.handle_user_input_error(ctx, e) elif isinstance(e, errors.CheckFailure): |