mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 22:08:26 +00:00
fix(discord): honor threadId for thread-reply
This commit is contained in:
@@ -127,4 +127,30 @@ describe("handleDiscordMessageAction", () => {
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it("accepts threadId for thread replies (tool compatibility)", async () => {
|
||||
sendMessageDiscord.mockClear();
|
||||
const handleDiscordMessageAction = await loadHandleDiscordMessageAction();
|
||||
|
||||
await handleDiscordMessageAction({
|
||||
action: "thread-reply",
|
||||
params: {
|
||||
// The `message` tool uses `threadId`.
|
||||
threadId: "999",
|
||||
// Include a conflicting channelId to ensure threadId takes precedence.
|
||||
channelId: "123",
|
||||
message: "hi",
|
||||
},
|
||||
cfg: {} as ClawdbotConfig,
|
||||
accountId: "ops",
|
||||
});
|
||||
|
||||
expect(sendMessageDiscord).toHaveBeenCalledWith(
|
||||
"channel:999",
|
||||
"hi",
|
||||
expect.objectContaining({
|
||||
accountId: "ops",
|
||||
}),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user