aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Chris Lovering <[email protected]>2022-06-13 17:23:54 +0100
committerGravatar Chris Lovering <[email protected]>2022-06-13 21:40:25 +0100
commit84d0e4d325eb6bc40c66c3f88161b10440f0320f (patch)
treeb6e12ea5e195ceb373dd8038c960059673a71be1
parentAdd reroll command. (#1568) (diff)
Auto bump nomination threads
Every nomination thread we call the thread bumper command this manually, so automating this is a no brainer.
-rw-r--r--bot/exts/recruitment/talentpool/_review.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/bot/exts/recruitment/talentpool/_review.py b/bot/exts/recruitment/talentpool/_review.py
index f94a15193..b6abdd24f 100644
--- a/bot/exts/recruitment/talentpool/_review.py
+++ b/bot/exts/recruitment/talentpool/_review.py
@@ -24,6 +24,7 @@ from bot.utils.messages import count_unique_users_reaction, pin_no_system_messag
if typing.TYPE_CHECKING:
from bot.exts.recruitment.talentpool._cog import TalentPool
+ from bot.exts.utils.thread_bumper import ThreadBumper
log = get_logger(__name__)
@@ -97,12 +98,17 @@ class Reviewer:
thread = await last_message.create_thread(
name=f"Nomination - {nominee}",
)
- await thread.send(fr"<@&{Roles.mod_team}> <@&{Roles.admins}>")
+ message = await thread.send(f"<@&{Roles.mod_team}> <@&{Roles.admins}>")
if update_database:
nomination = self._pool.cache.get(user_id)
await self.bot.api_client.patch(f"bot/nominations/{nomination['id']}", json={"reviewed": True})
+ bump_cog: ThreadBumper = self.bot.get_cog("ThreadBumper")
+ if bump_cog:
+ context = await self.bot.get_context(message)
+ await bump_cog.add_thread_to_bump_list(context, thread)
+
async def make_review(self, user_id: int) -> typing.Tuple[str, Optional[Emoji], Optional[Member]]:
"""Format a generic review of a user and return it with the reviewed emoji and the user themselves."""
log.trace(f"Formatting the review of {user_id}")