diff options
-rw-r--r-- | bot/exts/filters/filtering.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/bot/exts/filters/filtering.py b/bot/exts/filters/filtering.py index 70f59c1ee..1289dfe41 100644 --- a/bot/exts/filters/filtering.py +++ b/bot/exts/filters/filtering.py @@ -390,7 +390,12 @@ class Filtering(Cog): await self._send_log(filter_name, _filter, msg, stats, reason) # If the filter reason contains `[autoban]`, we want to auto-ban the user - if reason and "[autoban]" in reason.lower(): + autoban = reason and "[autoban]" in reason.lower() + if not autoban and filter_name == "filter_invites" and isinstance(result, dict): + autoban = any( + "[autoban]" in invite_info.get("reason", "").lower() for invite_info in result.values() + ) + if autoban: # Create a new context, with the author as is the bot, and the channel as #mod-alerts. # This sends the ban confirmation directly under watchlist trigger embed, to inform # mods that the user was auto-banned for the message. |