diff options
author | 2023-03-31 20:42:21 -0400 | |
---|---|---|
committer | 2023-03-31 20:42:21 -0400 | |
commit | 4c55833b189b728c6a716d7c19ab9e0aa5b900ef (patch) | |
tree | 3cf34e8908393e717f00c9fe5a1786bba516ecb5 | |
parent | Avoid race conditions and stricter cooldown (diff) |
Make new helper role pingable for help request.
Previously, the message from the bot requesting that new helpers answer off-topic questions did not cause a ping. Solved by this commit.
-rw-r--r-- | bot/exts/recruitment/helper_utils.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/bot/exts/recruitment/helper_utils.py b/bot/exts/recruitment/helper_utils.py index fe264f647..8af17fe7a 100644 --- a/bot/exts/recruitment/helper_utils.py +++ b/bot/exts/recruitment/helper_utils.py @@ -4,6 +4,7 @@ import re import arrow from async_rediscache import RedisCache +import discord from discord import Message from discord.ext.commands import Cog @@ -65,7 +66,8 @@ class NewHelperUtils(Cog): if self._is_question(message.content): self.last_pinged = arrow.utcnow() - await message.reply(random.choice(self.MESSAGES)) + allowed_mentions = discord.AllowedMentions(everyone=False, roles=[discord.Object(NEW_HELPER_ROLE_ID)]) + await message.reply(random.choice(self.MESSAGES), allowed_mentions=allowed_mentions) await self.cooldown_cache.set(self.CACHE_KEY, self.last_pinged.timestamp()) |