aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Chris Lovering <[email protected]>2021-12-03 14:56:09 +0000
committerGravatar Chris Lovering <[email protected]>2021-12-03 14:56:37 +0000
commitdb85e56baf7edbd204fae42572d01923ec398840 (patch)
treed021e0247f5478a97bb5f7b7dd4b4044aed25e7c
parentMerge pull request #1991 from python-discord/pep-main (diff)
Attepmt to fetch un-cached nomination threads on archive
Fixes BOT-1R0 Fixes #1992 The time between a vote passing and the helper being helpered can sometimes be >7 days, meaning the thread may have auto-archived by then. We should deal with this by trying to fetch the threead from the API if it's not cached.
-rw-r--r--bot/exts/recruitment/talentpool/_review.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/bot/exts/recruitment/talentpool/_review.py b/bot/exts/recruitment/talentpool/_review.py
index f6b81ae50..0e7194892 100644
--- a/bot/exts/recruitment/talentpool/_review.py
+++ b/bot/exts/recruitment/talentpool/_review.py
@@ -217,8 +217,11 @@ class Reviewer:
# 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:
- log.warning(f"Could not find a thread linked to {message.channel.id}-{message.id}")
- return
+ 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):