From 0bd2f1e8ac7bc3daaad6a0151cec19eaeae6c758 Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Sun, 3 Oct 2021 17:19:35 +0100 Subject: Block helpers from editing nomination reasons in channels other than #nominations --- bot/exts/recruitment/talentpool/_cog.py | 10 +++++++--- 1 file 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." -- cgit v1.2.3