File tree Expand file tree Collapse file tree
src/discord-cluster-manager/cogs Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -961,6 +961,13 @@ async def set_forum_ids(self, interaction: discord.Interaction):
961961 # search forum threads
962962 forum_channel = self .bot .get_channel (self .bot .leaderboard_forum_id )
963963 threads = [thread for thread in forum_channel .threads if thread .name == name ]
964+ if len (threads ) == 0 :
965+ # is it an archived thread?
966+ threads = [
967+ thread
968+ async for thread in forum_channel .archived_threads ()
969+ if thread .name == name
970+ ]
964971 if len (threads ) != 1 :
965972 await send_discord_message (
966973 interaction , f"Could not set forum thread for { name } " , ephemeral = True
@@ -973,8 +980,7 @@ async def set_forum_ids(self, interaction: discord.Interaction):
973980 SET forum_id = %s
974981 WHERE id = %s
975982 """ ,
976- thread .id ,
977- id ,
983+ (thread .id , id ),
978984 )
979985
980986 db .connection .commit ()
You can’t perform that action at this time.
0 commit comments