aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar LX <[email protected]>2023-05-01 23:43:21 +0100
committerGravatar GitHub <[email protected]>2023-05-01 23:43:21 +0100
commitaffd4179725eb7d46a430a16f6708e6d5fab3937 (patch)
treebcab3fa1ac6d5da5a1a43317184f77d745320702
parentMerge pull request #2572 from python-discord/dependabot/pip/coverage-7.2.5 (diff)
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.
-rw-r--r--bot/exts/filtering/filtering.py2
1 files changed, 1 insertions, 1 deletions
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: