aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Hassan Abouelela <[email protected]>2021-02-04 11:54:35 +0300
committerGravatar Hassan Abouelela <[email protected]>2021-02-04 11:54:35 +0300
commitb10e9b0e3f7de0daf52234f336e43154aa4c1e9a (patch)
tree90619cc027ce08b8f85b398bf075d758b82bae7f
parentUpdates Voice Channel Config (diff)
Restricts Voice Silence Skip To Mod Roles
Raises the permission required to not be muted during a voice silence to moderation roles.
-rw-r--r--bot/exts/moderation/silence.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/bot/exts/moderation/silence.py b/bot/exts/moderation/silence.py
index c15cbccaa..4253cd4f3 100644
--- a/bot/exts/moderation/silence.py
+++ b/bot/exts/moderation/silence.py
@@ -282,13 +282,16 @@ class Silence(commands.Cog):
log.debug(f"Removing all non staff members from #{channel.name} ({channel.id}).")
for member in channel.members:
- if self._helper_role not in member.roles:
- try:
- await member.move_to(None, reason="Kicking member from voice channel.")
- log.debug(f"Kicked {member.name} from voice channel.")
- except Exception as e:
- log.debug(f"Failed to move {member.name}. Reason: {e}")
- continue
+ # Skip staff
+ if any(role.id in constants.MODERATION_ROLES for role in member.roles):
+ continue
+
+ try:
+ await member.move_to(None, reason="Kicking member from voice channel.")
+ log.debug(f"Kicked {member.name} from voice channel.")
+ except Exception as e:
+ log.debug(f"Failed to move {member.name}. Reason: {e}")
+ continue
log.debug("Removed all members.")
@@ -306,7 +309,7 @@ class Silence(commands.Cog):
# Move all members to temporary channel and back
for member in channel.members:
# Skip staff
- if self._helper_role in member.roles:
+ if any(role.id in constants.MODERATION_ROLES for role in member.roles):
continue
try: