mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 13:01:25 +00:00
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
This commit is contained in:
@@ -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 }),
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user