fix(discord): default standalone threads to public type (#14147)

When creating a Discord thread without a messageId, the API defaults
to type 12 (private thread) which is unexpected. This adds an explicit
type: PublicThread (11) for standalone thread creation in non-forum
channels, matching user expectations.

Closes #14147
This commit is contained in:
Rain
2026-02-12 00:12:58 +08:00
committed by Shadow
parent b90610c099
commit 42f7538320

View File

@@ -122,6 +122,12 @@ export async function createThreadDiscord(
const starterContent = payload.content?.trim() ? payload.content : payload.name;
body.message = { content: starterContent };
}
// When creating a standalone thread (no messageId) in a non-forum channel,
// default to public thread (type 11). Discord defaults to private (type 12)
// which is unexpected for most users. (#14147)
if (!payload.messageId && !isForumLike && body.type === undefined) {
body.type = ChannelType.PublicThread;
}
const route = payload.messageId
? Routes.threads(channelId, payload.messageId)
: Routes.threads(channelId);