mirror of
https://github.com/ZHANGTIANYAO1/teamspeak-music-bot.git
synced 2026-12-03 03:12:51 +08:00
test(open-protocol): remove leftover slash assertion and formatting diff for PR
This commit is contained in:
1 parent
69b311283a
commit
066f12d91f
3 files changed
+3
-10
No files matched your search
@@ -1,9 +1,5 @@
|
||||
import { describe, it, expect } from "vitest";
|
||||
import {
|
||||
parseCommand,
|
||||
canRunCommand,
|
||||
isAdminCommand,
|
||||
} from "./commands.js";
|
||||
import { parseCommand, canRunCommand, isAdminCommand } from "./commands.js";
|
||||
|
||||
describe("Command Parser", () => {
|
||||
it("parses simple command", () => {
|
||||
|
||||
@@ -1950,15 +1950,12 @@ describe("BotInstance trackEnd — stale playback sessions", () => {
|
||||
});
|
||||
|
||||
describe("BotInstance — OpenProtocol & command routing", () => {
|
||||
it("ignores / commands when commandPrefix is '!' and routes private replies to invokerId", async () => {
|
||||
it("routes private DM command replies to invokerId and channel replies to the channel", async () => {
|
||||
const ctx = makeGateCtx({ adminGroups: [] });
|
||||
ctx.executeCommand = vi.fn(async (parsed: { name: string; args: string }) =>
|
||||
`ok:${parsed.name}:${parsed.args}`,
|
||||
);
|
||||
|
||||
await handleTextMessage.call(ctx, makeMsg("/play 晴天"));
|
||||
expect(ctx.executeCommand).not.toHaveBeenCalled();
|
||||
|
||||
const dm: TS3TextMessage = {
|
||||
invokerName: "FlSpeakUser",
|
||||
invokerId: "12",
|
||||
|
||||
+1
-1
@@ -826,7 +826,7 @@ export class BotInstance extends EventEmitter {
|
||||
const parsed = parseCommand(
|
||||
msg.message,
|
||||
this.config.commandPrefix,
|
||||
this.config.commandAliases,
|
||||
this.config.commandAliases
|
||||
);
|
||||
if (!parsed) return;
|
||||
|
||||
|
||||
Reference in new issue
Block a user