diff options
author | 2021-07-06 11:56:19 +0100 | |
---|---|---|
committer | 2021-07-06 10:56:19 +0000 | |
commit | 839e5250f1ba15db59e2e0d9b4f289391b7b87a0 (patch) | |
tree | 036f3d24372c2024a92b7dc02bf5071d749fca13 | |
parent | Merge pull request #1668 from python-discord/feat/code-jam-channels-automation (diff) |
Disable filter in codejam team channels (#1670)
* Disable filter_invites in codejam team channels
* Fix incorrect comment
Co-authored-by: ChrisJL <[email protected]>
Co-authored-by: ChrisJL <[email protected]>
-rw-r--r-- | bot/exts/filters/filtering.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/bot/exts/filters/filtering.py b/bot/exts/filters/filtering.py index 661d6c9a2..5d5f59590 100644 --- a/bot/exts/filters/filtering.py +++ b/bot/exts/filters/filtering.py @@ -20,6 +20,7 @@ from bot.constants import ( Guild, Icons, URLs ) from bot.exts.moderation.modlog import ModLog +from bot.exts.utils.jams import CATEGORY_NAME as JAM_CATEGORY_NAME from bot.utils.messages import format_user from bot.utils.regex import INVITE_RE from bot.utils.scheduling import Scheduler @@ -281,6 +282,12 @@ class Filtering(Cog): if delta is not None and delta < 100: continue + if filter_name == "filter_invites": + # Disable invites filter in codejam team channels + category = msg.channel.category + if category and category.name == JAM_CATEGORY_NAME: + continue + # Does the filter only need the message content or the full message? if _filter["content_only"]: payload = msg.content |