diff options
| author | 2020-04-11 10:28:47 -0700 | |
|---|---|---|
| committer | 2020-04-11 10:36:21 -0700 | |
| commit | 100a903d6604ac019adff0d4e197a092be2f273f (patch) | |
| tree | 7c270fc0a43ec0516598afc7a5c55980f0567192 | |
| parent | Stop setting positions when moving help channels (diff) | |
HelpChannels: create a helper method for checking a chann
| -rw-r--r-- | bot/cogs/help_channels.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/bot/cogs/help_channels.py b/bot/cogs/help_channels.py index 797019f69..d91f3f91f 100644 --- a/bot/cogs/help_channels.py +++ b/bot/cogs/help_channels.py @@ -521,7 +521,8 @@ class HelpChannels(Scheduler, commands.Cog): return # Ignore messages sent by bots. channel = message.channel - if channel.category and channel.category.id != constants.Categories.help_available: + category = getattr(channel, "category", None) + if category and category.id != constants.Categories.help_available: return # Ignore messages outside the Available category. log.trace("Waiting for the cog to be ready before processing messages.") @@ -531,7 +532,8 @@ class HelpChannels(Scheduler, commands.Cog): async with self.on_message_lock: log.trace(f"on_message lock acquired for {message.id}.") - if channel.category and channel.category.id != constants.Categories.help_available: + category = getattr(channel, "category", None) + if category and category.id != constants.Categories.help_available: log.debug( f"Message {message.id} will not make #{channel} ({channel.id}) in-use " f"because another message in the channel already triggered that." |