aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Chris Lovering <[email protected]>2021-10-03 17:19:35 +0100
committerGravatar Chris Lovering <[email protected]>2021-10-03 17:19:35 +0100
commit0bd2f1e8ac7bc3daaad6a0151cec19eaeae6c758 (patch)
tree52fd0795acccb56311fd95fe7a52a56edaa20c89
parentForce kwargs when calling helper util (diff)
Block helpers from editing nomination reasons in channels other than #nominations
-rw-r--r--bot/exts/recruitment/talentpool/_cog.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/bot/exts/recruitment/talentpool/_cog.py b/bot/exts/recruitment/talentpool/_cog.py
index 70535095d..98e83f309 100644
--- a/bot/exts/recruitment/talentpool/_cog.py
+++ b/bot/exts/recruitment/talentpool/_cog.py
@@ -372,9 +372,13 @@ class TalentPool(Cog, name="Talentpool"):
# If not specified, assume the invoker is editing their own nomination reason.
nominator = nominator or ctx.author
- if nominator != ctx.author or isinstance(nominee_or_nomination_id, int):
- # Invoker has specified another nominator, or a specific nomination id
- if not any(role.id in MODERATION_ROLES for role in ctx.author.roles):
+ if not any(role.id in MODERATION_ROLES for role in ctx.author.roles):
+ if ctx.channel.id != Channels.nominations:
+ await ctx.send(f":x: Nomination edits must be run in the <#{Channels.nominations}> channel")
+ return
+
+ if nominator != ctx.author or isinstance(nominee_or_nomination_id, int):
+ # Invoker has specified another nominator, or a specific nomination id
raise BadArgument(
"Only moderators can edit specific nomination IDs, "
"or the reason of a nominator other than themselves."