





















@@ -79,11 +79,17 @@ describe("discord channel message adapter", () => {
7979text: "hello",
8080accountId: "default",
8181});
82-expect(hoisted.sendMessageDiscordMock).toHaveBeenLastCalledWith(
83-"channel:123456",
84-"hello",
85-expect.objectContaining({ accountId: "default" }),
86-);
82+expect(hoisted.sendMessageDiscordMock).toHaveBeenLastCalledWith("channel:123456", "hello", {
83+verbose: false,
84+replyTo: undefined,
85+accountId: "default",
86+silent: undefined,
87+cfg: {},
88+textLimit: undefined,
89+maxLinesPerMessage: undefined,
90+tableMode: undefined,
91+chunkMode: undefined,
92+});
8793expect(result.receipt.platformMessageIds).toEqual(["msg-1"]);
8894expect(result.receipt.parts[0]?.kind).toBe("text");
8995};
@@ -97,14 +103,21 @@ describe("discord channel message adapter", () => {
97103mediaUrl: "https://example.com/a.png",
98104accountId: "default",
99105});
100-expect(hoisted.sendMessageDiscordMock).toHaveBeenLastCalledWith(
101-"channel:123456",
102-"caption",
103-expect.objectContaining({
104-accountId: "default",
105-mediaUrl: "https://example.com/a.png",
106-}),
107-);
106+expect(hoisted.sendMessageDiscordMock).toHaveBeenLastCalledWith("channel:123456", "caption", {
107+verbose: false,
108+mediaUrl: "https://example.com/a.png",
109+mediaAccess: undefined,
110+mediaLocalRoots: undefined,
111+mediaReadFile: undefined,
112+replyTo: undefined,
113+accountId: "default",
114+silent: undefined,
115+cfg: {},
116+textLimit: undefined,
117+maxLinesPerMessage: undefined,
118+tableMode: undefined,
119+chunkMode: undefined,
120+});
108121expect(result.receipt.parts[0]?.kind).toBe("media");
109122};
110123@@ -117,11 +130,17 @@ describe("discord channel message adapter", () => {
117130payload: { text: "payload" },
118131accountId: "default",
119132});
120-expect(hoisted.sendMessageDiscordMock).toHaveBeenLastCalledWith(
121-"channel:123456",
122-"payload",
123-expect.objectContaining({ accountId: "default" }),
124-);
133+expect(hoisted.sendMessageDiscordMock).toHaveBeenLastCalledWith("channel:123456", "payload", {
134+verbose: false,
135+replyTo: undefined,
136+accountId: "default",
137+silent: undefined,
138+cfg: {},
139+textLimit: undefined,
140+maxLinesPerMessage: undefined,
141+tableMode: undefined,
142+chunkMode: undefined,
143+});
125144expect(result.receipt.platformMessageIds).toEqual(["msg-1"]);
126145};
127146@@ -139,11 +158,17 @@ describe("discord channel message adapter", () => {
139158expect(hoisted.sendMessageDiscordMock).toHaveBeenLastCalledWith(
140159"channel:thread-1",
141160"threaded",
142-expect.objectContaining({
161+{
162+verbose: false,
143163accountId: "default",
144164replyTo: "reply-1",
145165silent: true,
146-}),
166+cfg: {},
167+textLimit: undefined,
168+maxLinesPerMessage: undefined,
169+tableMode: undefined,
170+chunkMode: undefined,
171+},
147172);
148173expect(result.receipt.threadId).toBe("thread-1");
149174expect(result.receipt.replyToId).toBe("reply-1");
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。