aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar xithrius <[email protected]>2021-01-05 21:33:32 -0800
committerGravatar xithrius <[email protected]>2021-01-05 21:33:32 -0800
commit431afbfa48149d315d92c7c3ffb7974e5ae20618 (patch)
treed1e4ef800e911424d0c6f4238da38c50b34108e6
parentRemoved possibility of exception via walrus. (diff)
If user is a staff member, no command suggestions.
-rw-r--r--bot/exts/backend/error_handler.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/bot/exts/backend/error_handler.py b/bot/exts/backend/error_handler.py
index fa3f706e6..412c42df5 100644
--- a/bot/exts/backend/error_handler.py
+++ b/bot/exts/backend/error_handler.py
@@ -9,7 +9,7 @@ from sentry_sdk import push_scope
from bot.api import ResponseCodeError
from bot.bot import Bot
-from bot.constants import Channels, Colours, Icons
+from bot.constants import Channels, Colours, Icons, STAFF_ROLES
from bot.converters import TagNameConverter
from bot.errors import LockedResourceError
from bot.utils.checks import InWhitelistCheckFailure
@@ -159,12 +159,13 @@ class ErrorHandler(Cog):
with contextlib.suppress(ResponseCodeError):
await ctx.invoke(tags_get_command, tag_name=tag_name)
- tags_cog = self.bot.get_cog("Tags")
- command_name = ctx.invoked_with
- sent = await tags_cog.display_tag(ctx, command_name)
+ if not any(role.id in STAFF_ROLES for role in ctx.author.roles):
+ tags_cog = self.bot.get_cog("Tags")
+ command_name = ctx.invoked_with
+ sent = await tags_cog.display_tag(ctx, command_name)
- if not sent:
- await self.send_command_suggestion(ctx, command_name)
+ if not sent:
+ await self.send_command_suggestion(ctx, command_name)
# Return to not raise the exception
return