aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Hassan Abouelela <[email protected]>2020-11-23 14:00:18 +0300
committerGravatar Hassan Abouelela <[email protected]>2020-11-23 14:00:18 +0300
commit7569fefee98e17922857bc3aa4bdcb806c76874b (patch)
tree23a5b2b28ab100dd410b671e24e76917e956fe65
parentFix Failing Functions (diff)
Fixes Voice Silence Reporting
Fixes the channel reported as muted to voice channel chat channels when silencing voice channels. Signed-off-by: Hassan Abouelela <[email protected]>
-rw-r--r--bot/exts/moderation/silence.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/bot/exts/moderation/silence.py b/bot/exts/moderation/silence.py
index 87327e72a..2d928182a 100644
--- a/bot/exts/moderation/silence.py
+++ b/bot/exts/moderation/silence.py
@@ -108,11 +108,10 @@ class Silence(commands.Cog):
target_channel: Union[TextChannel, VoiceChannel],
alert_target: bool = False, duration: HushDurationConverter = 0) -> None:
"""Helper function to send message confirmation to `source_channel`, and notification to `target_channel`."""
- if isinstance(source_channel, TextChannel):
- await source_channel.send(
- message.replace("current", target_channel.mention if source_channel != target_channel else "current")
- .replace("{duration}", str(duration))
- )
+ await source_channel.send(
+ message.replace("current", target_channel.mention if source_channel != target_channel else "current")
+ .replace("{duration}", str(duration))
+ )
voice_chat = None
if isinstance(target_channel, VoiceChannel):
@@ -136,7 +135,7 @@ class Silence(commands.Cog):
return
await voice_chat.send(
- message.replace("{duration}", str(duration)).replace("current", voice_chat.mention)
+ message.replace("{duration}", str(duration)).replace("current", target_channel.mention)
)
else: