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

@@ -720,6 +720,7 @@ describe("monitorDiscordProvider", () => {
const commandNames = (createDiscordNativeCommandMock.mock.calls as Array<unknown[]>)
.map((call) => (call[0] as { command?: { name?: string } } | undefined)?.command?.name)
.filter((value): value is string => typeof value === "string");
expect(getPluginCommandSpecsMock).toHaveBeenCalledWith("discord");
expect(commandNames).toContain("cmd");
expect(commandNames).toContain("cron_jobs");
});

View File

@@ -135,7 +135,7 @@ function appendPluginCommandSpecs(params: {
const existingNames = new Set(
merged.map((spec) => spec.name.trim().toLowerCase()).filter(Boolean),
);
for (const pluginCommand of getPluginCommandSpecs()) {
for (const pluginCommand of getPluginCommandSpecs("discord")) {
const normalizedName = pluginCommand.name.trim().toLowerCase();
if (!normalizedName) {
continue;