From a4aff5c262329a6d87b093957049e8fbcf3037bf Mon Sep 17 00:00:00 2001 From: SamTheKorean Date: Fri, 24 Apr 2026 17:06:42 -0400 Subject: [PATCH] add discord --- src/discord.ts | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/discord.ts b/src/discord.ts index 2c0c1dc..cd7574f 100644 --- a/src/discord.ts +++ b/src/discord.ts @@ -58,26 +58,15 @@ export async function getForumPosts( ): Promise { const headers = { Authorization: `Bot ${botToken}` }; - const [activeRes, archivedRes] = await Promise.all([ - fetch(`https://discord.com/api/v10/guilds/${guildId}/threads/active`, { headers }), - fetch(`https://discord.com/api/v10/channels/${forumChannelId}/threads/archived/public?limit=50`, { headers }), - ]); + const activeRes = await fetch(`https://discord.com/api/v10/guilds/${guildId}/threads/active`, { headers }); if (!activeRes.ok) { const data = await activeRes.json() as any; throw new Error(`Failed to get active threads: ${JSON.stringify(data)}`); } - if (!archivedRes.ok) { - const data = await archivedRes.json() as any; - throw new Error(`Failed to get archived threads: ${JSON.stringify(data)}`); - } const activeData = await activeRes.json() as any; - const archivedData = await archivedRes.json() as any; - - const activeThreads = (activeData.threads ?? []).filter((t: any) => t.parent_id === forumChannelId); - const archivedThreads = archivedData.threads ?? []; - const allThreads = [...activeThreads, ...archivedThreads]; + const allThreads = (activeData.threads ?? []).filter((t: any) => t.parent_id === forumChannelId); const posts = await Promise.all( allThreads.map(async (thread: any) => {