Skip to content

Commit 6236a4c

Browse files
authored
Merge pull request #3306 from python-discord/remove-ping-on-auto-ban
Remove pings when auto-banning in filters
2 parents 90a7f74 + 72e8fe9 commit 6236a4c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

bot/exts/filtering/filtering.py

Lines changed: 4 additions & 1 deletion
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)