mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-19 08:58:37 +00:00
fix: use canonical 'direct' instead of 'dm' for DM peer kind (fixes TS2322)
This commit is contained in:
@@ -889,7 +889,7 @@ describe("discord DM reaction handling", () => {
|
|||||||
|
|
||||||
expect(resolveAgentRouteMock).toHaveBeenCalledOnce();
|
expect(resolveAgentRouteMock).toHaveBeenCalledOnce();
|
||||||
const routeArgs = resolveAgentRouteMock.mock.calls[0][0];
|
const routeArgs = resolveAgentRouteMock.mock.calls[0][0];
|
||||||
expect(routeArgs.peer).toEqual({ kind: "dm", id: "user-42" });
|
expect(routeArgs.peer).toEqual({ kind: "direct", id: "user-42" });
|
||||||
});
|
});
|
||||||
|
|
||||||
it("routes group DM reactions with peer kind 'group'", async () => {
|
it("routes group DM reactions with peer kind 'group'", async () => {
|
||||||
|
|||||||
@@ -276,7 +276,7 @@ async function handleDiscordReactionEvent(params: {
|
|||||||
accountId: params.accountId,
|
accountId: params.accountId,
|
||||||
guildId: data.guild_id ?? undefined,
|
guildId: data.guild_id ?? undefined,
|
||||||
peer: {
|
peer: {
|
||||||
kind: isDirectMessage ? "dm" : isGroupDm ? "group" : "channel",
|
kind: isDirectMessage ? "direct" : isGroupDm ? "group" : "channel",
|
||||||
id: isDirectMessage ? user.id : data.channel_id,
|
id: isDirectMessage ? user.id : data.channel_id,
|
||||||
},
|
},
|
||||||
parentPeer: parentId ? { kind: "channel", id: parentId } : undefined,
|
parentPeer: parentId ? { kind: "channel", id: parentId } : undefined,
|
||||||
|
|||||||
Reference in New Issue
Block a user