Skip to content

Commit 995770d

Browse files
committed
test(qqbot): fix group allways test imports
1 parent 948cd82 commit 995770d

2 files changed

Lines changed: 10 additions & 8 deletions

File tree

extensions/qqbot/src/engine/commands/builtin/register-group-allways.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
// Qqbot tests cover group-allways command plugin behavior.
22
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-contracts";
33
import { beforeEach, describe, expect, it, vi } from "vitest";
4-
import type { QueuedMessage } from "../gateway/message-queue.js";
5-
import type { GatewayAccount } from "../gateway/types.js";
6-
import { sendText } from "../messaging/sender.js";
7-
import { trySlashCommand } from "./slash-command-handler.js";
8-
import { getWrittenQQBotConfig, installCommandRuntime } from "./slash-command-test-support.js";
4+
import type { QueuedMessage } from "../../gateway/message-queue.js";
5+
import type { GatewayAccount } from "../../gateway/types.js";
6+
import { sendText } from "../../messaging/sender.js";
7+
import { trySlashCommand } from "../slash-command-handler.js";
8+
import { installCommandRuntime } from "../slash-command-test-support.js";
99

10-
vi.mock("../messaging/outbound.js", () => ({
10+
vi.mock("../../messaging/outbound.js", () => ({
1111
sendDocument: vi.fn(async () => undefined),
1212
}));
1313

14-
vi.mock("../messaging/sender.js", () => ({
14+
vi.mock("../../messaging/sender.js", () => ({
1515
accountToCreds: vi.fn(() => ({ appId: "app", clientSecret: "" })),
1616
buildDeliveryTarget: vi.fn(() => ({ targetType: "c2c", targetId: "TRUSTED_OPENID" })),
1717
sendText: vi.fn(async () => undefined),

extensions/qqbot/src/engine/commands/builtin/register-group-allways.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ export function registerGroupAllwaysCommand(registry: SlashCommandRegistry): voi
9494
const accountId = ctx.accountId;
9595
const isNamedAccount =
9696
accountId !== "default" &&
97-
!!(qqbot.accounts as Record<string, Record<string, unknown>> | undefined)?.[accountId];
97+
Boolean(
98+
(qqbot.accounts as Record<string, Record<string, unknown>> | undefined)?.[accountId],
99+
);
98100

99101
if (isNamedAccount) {
100102
// 命名账户:更新 accounts.{accountId}.defaultRequireMention

0 commit comments

Comments
 (0)