diff options
| author | 2019-12-12 08:58:43 +0100 | |
|---|---|---|
| committer | 2019-12-12 08:58:43 +0100 | |
| commit | 9e5e36768624a4c18c5e82d31fd30ca563cb6daa (patch) | |
| tree | 9fa7413723221002755fc19554590c1f789664c9 | |
| parent | Infractions: kick user from voice after muting (#644) (diff) | |
| parent | Fix tag fallback not respecting checks (#687) (diff) | |
Merge branch 'master' into enhancement/644-mute-kicks-voice
| -rw-r--r-- | bot/cogs/error_handler.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/bot/cogs/error_handler.py b/bot/cogs/error_handler.py index 49411814c..5fba9633b 100644 --- a/bot/cogs/error_handler.py +++ b/bot/cogs/error_handler.py @@ -75,6 +75,16 @@ class ErrorHandler(Cog): tags_get_command = self.bot.get_command("tags get") ctx.invoked_from_error_handler = True + log_msg = "Cancelling attempt to fall back to a tag due to failed checks." + try: + if not await tags_get_command.can_run(ctx): + log.debug(log_msg) + return + except CommandError as tag_error: + log.debug(log_msg) + await self.on_command_error(ctx, tag_error) + return + # Return to not raise the exception with contextlib.suppress(ResponseCodeError): await ctx.invoke(tags_get_command, tag_name=ctx.invoked_with) |