aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Chris Lovering <[email protected]>2021-06-29 18:26:03 +0100
committerGravatar Chris Lovering <[email protected]>2021-06-29 18:26:33 +0100
commitfc30c540d62ae2d0a04c3f33313a3d2744c3fa94 (patch)
treefd1f631980a3b8dc652b37f5a00c143f8db7a8e8
parentMerge pull request #1626 from python-discord/xdist (diff)
Ensure mods cannot be watched
This meant admins could also be watched, meaning their messages in ancy channel would be relayed to the BB channel.
-rw-r--r--bot/exts/moderation/watchchannels/bigbrother.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/bot/exts/moderation/watchchannels/bigbrother.py b/bot/exts/moderation/watchchannels/bigbrother.py
index 3b44056d3..c6ee844ef 100644
--- a/bot/exts/moderation/watchchannels/bigbrother.py
+++ b/bot/exts/moderation/watchchannels/bigbrother.py
@@ -94,6 +94,11 @@ class BigBrother(WatchChannel, Cog, name="Big Brother"):
await ctx.send(f":x: {user} is already being watched.")
return
+ # FetchedUser instances don't have a roles attribute
+ if hasattr(user, "roles") and any(role.id in MODERATION_ROLES for role in user.roles):
+ await ctx.send(f":x: I'm sorry {ctx.author}, I'm afraid I can't do that. I must be kind to my masters.")
+ return
+
response = await post_infraction(ctx, user, 'watch', reason, hidden=True, active=True)
if response is not None: