From 9e92fc8fa125122716a8bddaf9ba9711b7aab788 Mon Sep 17 00:00:00 2001 From: Rain Date: Thu, 12 Feb 2026 00:13:14 +0800 Subject: [PATCH] fix(discord): default standalone threads to public type (#14147) When creating a Discord thread without a messageId (standalone thread), the Discord API defaults to type 12 (private). Most users expect public. - Default standalone non-forum threads to ChannelType.PublicThread (11) - Add optional type field to DiscordThreadCreate for explicit control Closes #14147 --- src/discord/send.creates-thread.test.ts | 4 +++- src/discord/send.types.ts | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/discord/send.creates-thread.test.ts b/src/discord/send.creates-thread.test.ts index 3b332c06bc4..3d89b507a7e 100644 --- a/src/discord/send.creates-thread.test.ts +++ b/src/discord/send.creates-thread.test.ts @@ -114,7 +114,9 @@ describe("sendMessageDiscord", () => { await createThreadDiscord("chan1", { name: "thread" }, { rest, token: "t" }); expect(postMock).toHaveBeenCalledWith( Routes.threads("chan1"), - expect.objectContaining({ body: { name: "thread" } }), + expect.objectContaining({ + body: expect.objectContaining({ name: "thread", type: ChannelType.PublicThread }), + }), ); }); diff --git a/src/discord/send.types.ts b/src/discord/send.types.ts index 5a171a75669..318a03002e8 100644 --- a/src/discord/send.types.ts +++ b/src/discord/send.types.ts @@ -72,6 +72,8 @@ export type DiscordThreadCreate = { name: string; autoArchiveMinutes?: number; content?: string; + /** Discord thread type (default: PublicThread for standalone threads). */ + type?: number; }; export type DiscordThreadList = {