aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Mark <[email protected]>2020-04-17 10:09:23 -0700
committerGravatar GitHub <[email protected]>2020-04-17 10:09:23 -0700
commit27ed536350640fd1ce3fee5c21cfa6b495b4793e (patch)
tree0a62a5185550633d79f98454b0a90a0ae481f96e
parentHelpChannels: create helper method for checking channel's category (diff)
HelpChannels: ensure `is_in_category` returns a bool
Co-Authored-By: kwzrd <[email protected]>
-rw-r--r--bot/cogs/help_channels.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/bot/cogs/help_channels.py b/bot/cogs/help_channels.py
index 56caa60af..170812d1b 100644
--- a/bot/cogs/help_channels.py
+++ b/bot/cogs/help_channels.py
@@ -380,7 +380,7 @@ class HelpChannels(Scheduler, commands.Cog):
def is_in_category(channel: discord.TextChannel, category_id: int) -> bool:
"""Return True if `channel` is within a category with `category_id`."""
actual_category = getattr(channel, "category", None)
- return actual_category and actual_category.id == category_id
+ return actual_category is not None and actual_category.id == category_id
async def move_idle_channel(self, channel: discord.TextChannel, has_task: bool = True) -> None:
"""