diff options
| author | 2021-08-17 08:45:19 -0500 | |
|---|---|---|
| committer | 2021-08-17 08:45:19 -0500 | |
| commit | e098273a3ddd3afd8b254aad439b08fc380ff40e (patch) | |
| tree | 21e57bd813ffd5cc05aee3844cb6b362f10d6a0e /bot/utils/checks.py | |
| parent | Removed a massive it block (diff) | |
| parent | Merge pull request #792 from python-discord/more-py-topics (diff) | |
Merge branch 'main' into main
Diffstat (limited to 'bot/utils/checks.py')
| -rw-r--r-- | bot/utils/checks.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/bot/utils/checks.py b/bot/utils/checks.py index c06b6870..438ec750 100644 --- a/bot/utils/checks.py +++ b/bot/utils/checks.py @@ -75,6 +75,11 @@ def in_whitelist_check( log.trace(f"{ctx.author} may use the `{ctx.command.name}` command as they are in a whitelisted category.") return True + category = getattr(ctx.channel, "category", None) + if category and category.name == constants.codejam_categories_name: + log.trace(f"{ctx.author} may use the `{ctx.command.name}` command as they are in a codejam team channel.") + return True + # Only check the roles whitelist if we have one and ensure the author's roles attribute returns # an iterable to prevent breakage in DM channels (for if we ever decide to enable commands there). if roles and any(r.id in roles for r in getattr(ctx.author, "roles", ())): |