From bea4e8d24122a3ef80ba000d11a6bd68dad267a5 Mon Sep 17 00:00:00 2001 From: Johannes Christ Date: Mon, 5 Aug 2019 21:37:12 +0200 Subject: Suppress response code errors on tag reinvoke. --- bot/cogs/error_handler.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) -- cgit v1.2.3