diff options
author | 2020-04-13 11:08:26 -0700 | |
---|---|---|
committer | 2020-04-17 11:43:32 -0700 | |
commit | 06d12a02b91535b8536f877fdcd0d85aac6b1039 (patch) | |
tree | fdbe4802f3218a18a6f1a1175ae49e88a6c90a36 | |
parent | HelpChannels: remove ensure_permissions_synchronization (diff) |
HelpChannels: add helper function to check for claimant role
-rw-r--r-- | bot/cogs/help_channels.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/bot/cogs/help_channels.py b/bot/cogs/help_channels.py index 56d2d26cd..d47a42ca6 100644 --- a/bot/cogs/help_channels.py +++ b/bot/cogs/help_channels.py @@ -412,6 +412,11 @@ class HelpChannels(Scheduler, commands.Cog): self.bot.stats.gauge("help.total.available", total_available) self.bot.stats.gauge("help.total.dormant", total_dormant) + @staticmethod + def is_claimant(member: discord.Member) -> bool: + """Return True if `member` has the 'Help Cooldown' role.""" + return any(constants.Roles.help_cooldown == role.id for role in member.roles) + def is_dormant_message(self, message: t.Optional[discord.Message]) -> bool: """Return True if the contents of the `message` match `DORMANT_MSG`.""" if not message or not message.embeds: |