fix(discord): avoid native plugin command collisions

This commit is contained in:
Peter Steinberger
2026-03-07 21:59:12 +00:00
parent 4dcd930923
commit be9ea991de
9 changed files with 77 additions and 9 deletions

View File

@@ -59,4 +59,39 @@ describe("registerPluginCommand", () => {
},
]);
});
it("supports provider-specific native command aliases", () => {
const result = registerPluginCommand("demo-plugin", {
name: "voice",
nativeNames: {
default: "talkvoice",
discord: "discordvoice",
},
description: "Demo command",
handler: async () => ({ text: "ok" }),
});
expect(result).toEqual({ ok: true });
expect(getPluginCommandSpecs()).toEqual([
{
name: "talkvoice",
description: "Demo command",
acceptsArgs: false,
},
]);
expect(getPluginCommandSpecs("discord")).toEqual([
{
name: "discordvoice",
description: "Demo command",
acceptsArgs: false,
},
]);
expect(getPluginCommandSpecs("telegram")).toEqual([
{
name: "talkvoice",
description: "Demo command",
acceptsArgs: false,
},
]);
});
});