fix(discord): replyToMode first behaviour

This commit is contained in:
CHISEN Kaoru
2026-02-07 08:10:58 +00:00
committed by Shadow
parent 4b3c9c9c5a
commit e25ae55879
4 changed files with 46 additions and 9 deletions

View File

@@ -93,7 +93,22 @@ describe("resolveDiscordReplyDeliveryPlan", () => {
threadChannel: { id: "thread" },
createdThreadId: null,
});
// "all" returns the reference on every call.
expect(plan.replyReference.use()).toBe("m1");
expect(plan.replyReference.use()).toBe("m1");
});
it("uses existingId only on first call with replyToMode first inside a thread", () => {
const plan = resolveDiscordReplyDeliveryPlan({
replyTarget: "channel:thread",
replyToMode: "first",
messageId: "m1",
threadChannel: { id: "thread" },
createdThreadId: null,
});
// "first" returns the reference only once.
expect(plan.replyReference.use()).toBe("m1");
expect(plan.replyReference.use()).toBeUndefined();
});
});