diff --git a/extensions/discord/src/monitor/native-command.plugin-dispatch.test.ts b/extensions/discord/src/monitor/native-command.plugin-dispatch.test.ts index 5f233fa1784..c8077c5c98a 100644 --- a/extensions/discord/src/monitor/native-command.plugin-dispatch.test.ts +++ b/extensions/discord/src/monitor/native-command.plugin-dispatch.test.ts @@ -16,7 +16,7 @@ import { } from "../../../../test/helpers/plugins/plugin-registry.js"; import { resolveDiscordNativeInteractionRouteState } from "./native-command-route.js"; import { - createMockCommandInteraction, + createMockCommandInteraction as createInteraction, type MockCommandInteraction, } from "./native-command.test-helpers.js"; import { createNoopThreadBindingManager } from "./thread-bindings.manager.js"; @@ -30,26 +30,6 @@ const runtimeModuleMocks = vi.hoisted(() => ({ resolveDirectStatusReplyForSession: vi.fn(), })); -function createInteraction(params?: { - channelType?: ChannelType; - channelId?: string; - threadParentId?: string | null; - guildId?: string; - guildName?: string; -}): MockCommandInteraction { - return createMockCommandInteraction({ - userId: "owner", - username: "tester", - globalName: "Tester", - channelType: params?.channelType ?? ChannelType.DM, - channelId: params?.channelId ?? "dm-1", - threadParentId: params?.threadParentId, - guildId: params?.guildId ?? null, - guildName: params?.guildName, - interactionId: "interaction-1", - }); -} - function createConfig(): OpenClawConfig { return { channels: { diff --git a/extensions/discord/src/monitor/native-command.status-direct.test.ts b/extensions/discord/src/monitor/native-command.status-direct.test.ts index 66c095e2493..15cab978edf 100644 --- a/extensions/discord/src/monitor/native-command.status-direct.test.ts +++ b/extensions/discord/src/monitor/native-command.status-direct.test.ts @@ -1,10 +1,7 @@ import { ChannelType } from "discord-api-types/v10"; import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime"; import { beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { - createMockCommandInteraction, - type MockCommandInteraction, -} from "./native-command.test-helpers.js"; +import { createMockCommandInteraction as createInteraction } from "./native-command.test-helpers.js"; import { createNoopThreadBindingManager } from "./thread-bindings.js"; const runtimeModuleMocks = vi.hoisted(() => ({ @@ -31,26 +28,6 @@ vi.mock("openclaw/plugin-sdk/command-status-runtime", () => ({ let createDiscordNativeCommand: typeof import("./native-command.js").createDiscordNativeCommand; let discordNativeCommandTesting: typeof import("./native-command.js").__testing; -function createInteraction(params?: { - channelType?: ChannelType; - channelId?: string; - threadParentId?: string | null; - guildId?: string | null; - guildName?: string; -}): MockCommandInteraction { - return createMockCommandInteraction({ - userId: "owner", - username: "tester", - globalName: "Tester", - channelType: params?.channelType ?? ChannelType.DM, - channelId: params?.channelId ?? "dm-1", - threadParentId: params?.threadParentId, - guildId: params?.guildId ?? null, - guildName: params?.guildName, - interactionId: "interaction-1", - }); -} - function createConfig(params?: { requireMention?: boolean }): OpenClawConfig { return { commands: {