mirror of
https://github.com/moltbot/moltbot.git
synced 2026-04-26 16:06:16 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user