mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-11 02:04:34 +00:00
fix(discord): send initial message for non-forum thread creation (#18117)
Co-authored-by: Shadow <shadow@openclaw.ai>
This commit is contained in:
@@ -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 = {}) {
|
||||
|
||||
Reference in New Issue
Block a user