mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 21:58:26 +00:00
fix(discord): avoid native plugin command collisions
This commit is contained in:
@@ -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");
|
||||
});
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user