Skip to content

Commit 72e8fe9

Browse files
committed
Remove pings when auto-banning in filters
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.
1 parent 90a7f74 commit 72e8fe9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

bot/exts/filtering/filtering.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,10 @@ async def _resolve_action(
978978
result_actions = None
979979
if actions:
980980
result_actions = reduce(ActionSettings.union, actions)
981-
981+
# If the action is a ban, mods don't want to be pinged.
982+
if infr_action := result_actions.get("infraction_and_notification"):
983+
if infr_action.infraction_type == Infraction.BAN:
984+
result_actions.pop("mentions", None)
982985
return result_actions, messages, triggers
983986

984987
async def _send_alert(self, ctx: FilterContext, triggered_filters: dict[FilterList, Iterable[str]]) -> None:

0 commit comments

Comments
 (0)