From ce355662afd55a5adf95335bbb50058b3eeb7891 Mon Sep 17 00:00:00 2001 From: wookie184 Date: Tue, 6 Jul 2021 17:11:41 +0100 Subject: Allow commands in code jam team channels --- bot/utils/checks.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'bot/utils') 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", ())): -- cgit v1.2.3