fix: use canonical 'direct' instead of 'dm' for DM peer kind (fixes TS2322)

This commit is contained in:
Marcus Castro
2026-02-12 09:31:35 -03:00
committed by Shadow
parent ea3fb9570c
commit f8c7ae9b5e
2 changed files with 2 additions and 2 deletions

View File

@@ -889,7 +889,7 @@ describe("discord DM reaction handling", () => {
expect(resolveAgentRouteMock).toHaveBeenCalledOnce();
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 () => {

View File

@@ -276,7 +276,7 @@ async function handleDiscordReactionEvent(params: {
accountId: params.accountId,
guildId: data.guild_id ?? undefined,
peer: {
kind: isDirectMessage ? "dm" : isGroupDm ? "group" : "channel",
kind: isDirectMessage ? "direct" : isGroupDm ? "group" : "channel",
id: isDirectMessage ? user.id : data.channel_id,
},
parentPeer: parentId ? { kind: "channel", id: parentId } : undefined,