fix(discord): send initial message for non-forum thread creation (#18117)

Co-authored-by: Shadow <shadow@openclaw.ai>
This commit is contained in:
zerone0x
2026-02-17 03:48:46 +08:00
committed by GitHub
parent 7c240a2b58
commit 81d2a91a90
3 changed files with 67 additions and 1 deletions

View File

@@ -134,7 +134,17 @@ export async function createThreadDiscord(
const route = payload.messageId
? Routes.threads(channelId, payload.messageId)
: Routes.threads(channelId);
return await rest.post(route, { body });
const thread = (await rest.post(route, { body })) as { id: string };
// For non-forum channels, send the initial message separately after thread creation.
// Forum channels handle this via the `message` field in the request body.
if (!isForumLike && payload.content?.trim()) {
await rest.post(Routes.channelMessages(thread.id), {
body: { content: payload.content },
});
}
return thread;
}
export async function listThreadsDiscord(payload: DiscordThreadList, opts: DiscordReactOpts = {}) {