diff options
author | 2020-10-17 18:02:21 +0300 | |
---|---|---|
committer | 2020-10-17 18:02:21 +0300 | |
commit | 1a330209ca81336b964dce6d6f711f6e127b5d73 (patch) | |
tree | 7b0244304e20eaa11a40e4c307c955b39afeb8e3 | |
parent | Centralize moderation channel checks (diff) |
Amended to work with current tests
-rw-r--r-- | bot/utils/channel.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/bot/utils/channel.py b/bot/utils/channel.py index d55faab57..615698cab 100644 --- a/bot/utils/channel.py +++ b/bot/utils/channel.py @@ -2,7 +2,8 @@ import logging import discord -from bot.constants import Categories, MODERATION_CHANNELS +from bot import constants +from bot.constants import Categories log = logging.getLogger(__name__) @@ -20,7 +21,8 @@ def is_mod_channel(channel: discord.TextChannel) -> bool: log.trace(f"Checking if #{channel} is a mod channel.") categories = (Categories.modmail, Categories.logs) - return channel.id in MODERATION_CHANNELS or any(is_in_category(channel, category) for category in categories) + return channel.id in constants.MODERATION_CHANNELS \ + or any(is_in_category(channel, category) for category in categories) def is_in_category(channel: discord.TextChannel, category_id: int) -> bool: |