Skip to content

Commit 98882d7

Browse files
committed
check archived threads
1 parent b82f0c5 commit 98882d7

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/discord-cluster-manager/cogs/admin_cog.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff 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()

0 commit comments

Comments
 (0)