Skip to content

Remove pings when auto-banning in filters #3306

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 31, 2025
Merged

Conversation

ChrisLovering
Copy link
Member

Mods no longer want to be pinged when a fitler results in an auto ban, but we still want the message to be sent to mod-alerts.

@ChrisLovering ChrisLovering requested a review from Jayy001 March 30, 2025 15:59
@ChrisLovering ChrisLovering requested a review from mbaruh as a code owner March 30, 2025 15:59
@ChrisLovering ChrisLovering linked an issue Mar 30, 2025 that may be closed by this pull request
Copy link

@Jayy001 Jayy001 left a comment

Choose a reason for hiding this comment

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

Lgtm

# If the action is a ban, mods don't want to be pinged.
if infr_action := result_actions.get("infraction_and_notification"):
if infr_action.infraction_type == Infraction.BAN:
del result_actions["mentions"]
Copy link
Member

Choose a reason for hiding this comment

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

What if there are no mentions?

Suggested change
del result_actions["mentions"]
result_actions.pop("mentions", None)

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed!

Mods no longer want to be pinged when a fitler results in an auto ban, but we still want the message to be sent to mod-alerts.
@ChrisLovering ChrisLovering force-pushed the remove-ping-on-auto-ban branch from de418f6 to 72e8fe9 Compare March 30, 2025 19:08
Copy link
Member

@vivekashok1221 vivekashok1221 left a comment

Choose a reason for hiding this comment

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

LGTM

@Jayy001 Jayy001 self-requested a review March 31, 2025 14:42
@mbaruh mbaruh merged commit 6236a4c into main Mar 31, 2025
5 checks passed
@mbaruh mbaruh deleted the remove-ping-on-auto-ban branch March 31, 2025 16:04
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.

Don't ping in #mod-alerts for bans
4 participants