aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bot/exts/recruitment/talentpool/_review.py30
1 files changed, 18 insertions, 12 deletions
diff --git a/bot/exts/recruitment/talentpool/_review.py b/bot/exts/recruitment/talentpool/_review.py
index be9456c37..5bd63f65e 100644
--- a/bot/exts/recruitment/talentpool/_review.py
+++ b/bot/exts/recruitment/talentpool/_review.py
@@ -283,6 +283,14 @@ class Reviewer:
"""Archive this vote to #nomination-archive."""
message = await message.fetch()
+ # Thread channel IDs are the same as the message ID of the parent message.
+ nomination_thread = message.guild.get_thread(message.id)
+ if not nomination_thread:
+ try:
+ nomination_thread = await message.guild.fetch_channel(message.id)
+ except NotFound:
+ log.warning(f"Could not find a thread linked to {message.channel.id}-{message.id}")
+
# We consider the first message in the nomination to contain the user ping, username#discrim, and fixed text
messages = [message]
if not NOMINATION_MESSAGE_REGEX.search(message.content):
@@ -327,9 +335,15 @@ class Reviewer:
colour = Colours.soft_green if passed else Colours.soft_red
timestamp = datetime.now(tz=UTC).strftime("%Y/%m/%d")
+ if nomination_thread:
+ thread_jump = f"[Jump to vote thread]({nomination_thread.jump_url})"
+ else:
+ thread_jump = "Failed to get thread"
+
embed_content = (
f"{result} on {timestamp}\n"
- f"With {reviewed} {Emojis.ducky_dave} {upvotes} :+1: {downvotes} :-1:\n\n"
+ f"With {reviewed} {Emojis.ducky_dave} {upvotes} :+1: {downvotes} :-1:\n"
+ f"{thread_jump}\n\n"
f"{stripped_content}"
)
@@ -348,21 +362,13 @@ class Reviewer:
colour=colour
))
- # Thread channel IDs are the same as the message ID of the parent message.
- nomination_thread = message.guild.get_thread(message.id)
- if not nomination_thread:
- try:
- nomination_thread = await message.guild.fetch_channel(message.id)
- except NotFound:
- log.warning(f"Could not find a thread linked to {message.channel.id}-{message.id}")
- return
-
for message_ in messages:
with contextlib.suppress(NotFound):
await message_.delete()
- with contextlib.suppress(NotFound):
- await nomination_thread.edit(archived=True)
+ if nomination_thread:
+ with contextlib.suppress(NotFound):
+ await nomination_thread.edit(archived=True)
async def _construct_review_body(self, member: Member) -> str:
"""Formats the body of the nomination, with details of activity, infractions, and previous nominations."""