diff options
| author | 2019-08-05 21:37:12 +0200 | |
|---|---|---|
| committer | 2019-08-05 21:37:12 +0200 | |
| commit | bea4e8d24122a3ef80ba000d11a6bd68dad267a5 (patch) | |
| tree | bdc00a7f2455d6119bfa21004fdcb1584185df44 | |
| parent | Finalize error handling. (diff) | |
Suppress response code errors on tag reinvoke.
| -rw-r--r-- | bot/cogs/error_handler.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/bot/cogs/error_handler.py b/bot/cogs/error_handler.py index 25aa177e1..62e2e2d7b 100644 --- a/bot/cogs/error_handler.py +++ b/bot/cogs/error_handler.py @@ -1,3 +1,4 @@ +import contextlib import logging from discord.ext.commands import ( @@ -46,7 +47,8 @@ class ErrorHandler: ctx.invoked_from_error_handler = True # Return to not raise the exception - return await ctx.invoke(tags_get_command, tag_name=ctx.invoked_with) + with contextlib.suppress(ResponseCodeError): + return await ctx.invoke(tags_get_command, tag_name=ctx.invoked_with) elif isinstance(e, BadArgument): await ctx.send(f"Bad argument: {e}\n") await ctx.invoke(*help_command) |