Skip to content

Tighter mention filtering in auto-ban mod-alerts#3530

Merged
jb3 merged 2 commits into
mainfrom
jb3/tighter-mention-filtering
Jun 29, 2026
Merged

Tighter mention filtering in auto-ban mod-alerts#3530
jb3 merged 2 commits into
mainfrom
jb3/tighter-mention-filtering

Conversation

@jb3

@jb3 jb3 commented Jun 28, 2026

Copy link
Copy Markdown
Member

For filters that resolve to infraction_type=BAN, the resolver no longer removes the entire mentions action. Instead, it now strips only:

  • the Moderators role ping
  • @here
  • @everyone

All other configured guild_pings/dm_pings are preserved and still included in mod alerts (e.g. if a user has explicitly added themselves to a specific filter).

Also added a test for _clean_ban_mentions to verify moderator/here/everyone mentions get removed and other mentions remain.

@jb3 jb3 requested a review from mbaruh as a code owner June 28, 2026 23:23
@swfarnsworth

Copy link
Copy Markdown
Contributor

Desired behavior confirmed; screenshot shows two evocations of the filter before and after adding BAN as the infraction response.

image

@swfarnsworth

Copy link
Copy Markdown
Contributor
image

Confirmed also for @here, for whatever that's worth.

Comment thread bot/exts/filtering/filtering.py
@swfarnsworth

swfarnsworth commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Thank you @jb3 for such a quick turnaround on this QoL improvement!

@shtlrs shtlrs left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dear Joe.

That's it, no monologue.

@jb3 jb3 merged commit 2766b4a into main Jun 29, 2026
5 checks passed
@jb3 jb3 deleted the jb3/tighter-mention-filtering branch June 29, 2026 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants