aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Hassan Abouelela <[email protected]>2020-12-29 19:18:03 +0300
committerGravatar Hassan Abouelela <[email protected]>2020-12-29 19:18:03 +0300
commit1b747fccd16d2667c6f4129a222cd9ea3eda5602 (patch)
treed6b3185b99092661dbc3c5a8c7ed669a244e8a1a
parentAdds Error Handling For Voice Channel Muting (diff)
Makes Kick Keyword Only Parameter
-rw-r--r--bot/exts/moderation/silence.py4
-rw-r--r--tests/bot/exts/moderation/test_silence.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/bot/exts/moderation/silence.py b/bot/exts/moderation/silence.py
index 157c150fd..e91e558ec 100644
--- a/bot/exts/moderation/silence.py
+++ b/bot/exts/moderation/silence.py
@@ -171,7 +171,7 @@ class Silence(commands.Cog):
channel_info = f"#{channel} ({channel.id})"
log.debug(f"{ctx.author} is silencing channel {channel_info}.")
- if not await self._set_silence_overwrites(channel, kick):
+ if not await self._set_silence_overwrites(channel, kick=kick):
log.info(f"Tried to silence channel {channel_info} but the channel was already silenced.")
await self.send_message(MSG_SILENCE_FAIL, ctx.channel, channel)
return
@@ -231,7 +231,7 @@ class Silence(commands.Cog):
else:
await self.send_message(MSG_UNSILENCE_SUCCESS, msg_channel, channel, alert_target=True)
- async def _set_silence_overwrites(self, channel: TextOrVoiceChannel, kick: bool = False) -> bool:
+ async def _set_silence_overwrites(self, channel: TextOrVoiceChannel, *, kick: bool = False) -> bool:
"""Set silence permission overwrites for `channel` and return True if successful."""
# Get the original channel overwrites
if isinstance(channel, TextChannel):
diff --git a/tests/bot/exts/moderation/test_silence.py b/tests/bot/exts/moderation/test_silence.py
index 038e0a1a4..44c3620ac 100644
--- a/tests/bot/exts/moderation/test_silence.py
+++ b/tests/bot/exts/moderation/test_silence.py
@@ -586,7 +586,7 @@ class SilenceTests(unittest.IsolatedAsyncioTestCase):
self.assertTrue(await self.cog._set_silence_overwrites(self.voice_channel))
self.assertFalse(self.voice_overwrite.speak)
- self.assertTrue(await self.cog._set_silence_overwrites(self.voice_channel, True))
+ self.assertTrue(await self.cog._set_silence_overwrites(self.voice_channel, kick=True))
self.assertFalse(self.voice_overwrite.speak or self.voice_overwrite.connect)