diff options
| author | 2022-06-14 21:55:45 +0100 | |
|---|---|---|
| committer | 2022-06-14 21:55:45 +0100 | |
| commit | 0b8d2b39c01a40e6a20313e75163c31f16cf51c8 (patch) | |
| tree | f5aa799d60cda7c596d052a706adc6c27f4e9ebf | |
| parent | Merge pull request #2193 from python-discord/allow-char-info-in-all-channels-... (diff) | |
| parent | Merge branch 'main' into fix/bot#2194 (diff) | |
Merge pull request #2195 from python-discord/fix/bot#2194
Only check for autoban filters if reason key is present and not None
Diffstat (limited to '')
| -rw-r--r-- | bot/exts/filters/filtering.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/bot/exts/filters/filtering.py b/bot/exts/filters/filtering.py index 1289dfe41..13035c0c8 100644 --- a/bot/exts/filters/filtering.py +++ b/bot/exts/filters/filtering.py @@ -393,7 +393,9 @@ class Filtering(Cog): 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() + "[autoban]" in invite_info["reason"].lower() + for invite_info in result.values() + if invite_info.get("reason") ) if autoban: # Create a new context, with the author as is the bot, and the channel as #mod-alerts. |