


















@@ -89,13 +89,13 @@ function handleMessagingAction(
8989action: string,
9090params: Record<string, unknown>,
9191isActionEnabled: (key: keyof DiscordActionConfig) => boolean,
92+cfg: OpenClawConfig = DISCORD_TEST_CFG,
9293options?: {
9394mediaLocalRoots?: readonly string[];
9495mediaReadFile?: (filePath: string) => Promise<Buffer>;
9596},
96-cfg: OpenClawConfig = DISCORD_TEST_CFG,
9797) {
98-return handleDiscordMessagingAction(action, params, isActionEnabled, options, cfg);
98+return handleDiscordMessagingAction(action, params, isActionEnabled, cfg, options);
9999}
100100101101function handleGuildAction(
@@ -178,7 +178,6 @@ describe("handleDiscordMessagingAction", () => {
178178emoji: "✅",
179179},
180180enableAllActions,
181-undefined,
182181{
183182channels: {
184183discord: {
@@ -363,7 +362,7 @@ describe("handleDiscordMessagingAction", () => {
363362},
364363},
365364} as OpenClawConfig;
366-await handleMessagingAction("readMessages", { channelId: "C1" }, enableAllActions, {}, cfg);
365+await handleMessagingAction("readMessages", { channelId: "C1" }, enableAllActions, cfg);
367366expect(readMessagesDiscord).toHaveBeenCalledWith("C1", expect.any(Object), { cfg });
368367});
369368@@ -397,7 +396,6 @@ describe("handleDiscordMessagingAction", () => {
397396"fetchMessage",
398397{ guildId: "G1", channelId: "C1", messageId: "M1" },
399398enableAllActions,
400-{},
401399cfg,
402400);
403401expect(fetchMessageDiscord).toHaveBeenCalledWith("C1", "M1", { cfg });
@@ -471,6 +469,7 @@ describe("handleDiscordMessagingAction", () => {
471469mediaUrl: "/tmp/image.png",
472470},
473471enableAllActions,
472+DISCORD_TEST_CFG,
474473{ mediaLocalRoots: ["/tmp/agent-root"] },
475474);
476475expect(sendMessageDiscord).toHaveBeenCalledWith(
@@ -496,6 +495,7 @@ describe("handleDiscordMessagingAction", () => {
496495components: {},
497496},
498497enableAllActions,
498+DISCORD_TEST_CFG,
499499{ mediaLocalRoots: ["/tmp/agent-root"] },
500500);
501501此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。