aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar GDWR <[email protected]>2022-02-14 00:40:40 +0000
committerGravatar GDWR <[email protected]>2022-02-14 00:40:40 +0000
commit6e696174412371f48b8404d5dc303fe57c62c548 (patch)
tree09eb2935b335e091ad08a6a5c7a5a7b6e31a7e4b
parent♻️Remove `import discord` in favour of using `from discord` (diff)
👌 Run bad word check on all voice state updates.
-rw-r--r--bot/exts/filters/filtering.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/bot/exts/filters/filtering.py b/bot/exts/filters/filtering.py
index 983c2a56c..ae4ce5343 100644
--- a/bot/exts/filters/filtering.py
+++ b/bot/exts/filters/filtering.py
@@ -209,10 +209,9 @@ class Filtering(Cog):
await self._filter_message(after, delta)
@Cog.listener()
- async def on_voice_state_update(self, member: Member, before: VoiceState, after: VoiceState) -> None:
- """Checks for bad words in usernames when users initially joins a voice channel."""
- if after.channel and not before.channel:
- await self.check_bad_words_in_name(member)
+ async def on_voice_state_update(self, member: Member, *_) -> None:
+ """Checks for bad words in usernames when users join, switch or leave a voice channel."""
+ await self.check_bad_words_in_name(member)
def get_name_match(self, name: str) -> Optional[re.Match]:
"""Check bad words from passed string (name). Return the first match found."""