From affd4179725eb7d46a430a16f6708e6d5fab3937 Mon Sep 17 00:00:00 2001 From: LX Date: Mon, 1 May 2023 23:43:21 +0100 Subject: Update filtering.py to reduce nickname alert spam This updates the `on_voice_state_update` listener of the filtering cog. Currently, it calls `self._check_bad_name` where it should call `self._check_bad_display_name`. The difference is that the latter method rate-limits how often a filtering alert is sent for a specific user's display name. Using the former method results in spammy alerts when a user with a bad display name is in a voice channel. --- bot/exts/filtering/filtering.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/exts/filtering/filtering.py b/bot/exts/filtering/filtering.py index 52401f0c3..f52db8ef0 100644 --- a/bot/exts/filtering/filtering.py +++ b/bot/exts/filtering/filtering.py @@ -260,7 +260,7 @@ class Filtering(Cog): async def on_voice_state_update(self, member: discord.Member, *_) -> None: """Checks for bad words in usernames when users join, switch or leave a voice channel.""" ctx = FilterContext(Event.NICKNAME, member, None, member.display_name, None) - await self._check_bad_name(ctx) + await self._check_bad_display_name(ctx) @Cog.listener() async def on_thread_create(self, thread: Thread) -> None: -- cgit v1.2.3