mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 15:20:44 +00:00
fix: allow plugin commands on Slack when channel supports native commands (#64578)
Merged via squash.
Prepared head SHA: 2ec97bf0b3
Co-authored-by: rafaelreis-r <57492577+rafaelreis-r@users.noreply.github.com>
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Reviewed-by: @jalehman
This commit is contained in:
@@ -3,6 +3,7 @@ import { createChannelReplyPipeline } from "openclaw/plugin-sdk/channel-reply-pi
|
||||
import {
|
||||
resolveCommandAuthorizedFromAuthorizers,
|
||||
resolveNativeCommandSessionTargets,
|
||||
listProviderPluginCommandSpecs,
|
||||
} from "openclaw/plugin-sdk/command-auth";
|
||||
import { type ChatCommandDefinition, type CommandArgs } from "openclaw/plugin-sdk/command-auth";
|
||||
import {
|
||||
@@ -670,6 +671,17 @@ export async function registerSlackMonitorSlashCommands(params: {
|
||||
skillCommands,
|
||||
provider: "slack",
|
||||
});
|
||||
const existingNativeNames = new Set(
|
||||
nativeCommands.map((c) => normalizeLowercaseStringOrEmpty(c.name)).filter(Boolean),
|
||||
);
|
||||
for (const pluginCommand of listProviderPluginCommandSpecs("slack")) {
|
||||
const normalizedName = normalizeLowercaseStringOrEmpty(pluginCommand.name);
|
||||
if (!normalizedName || existingNativeNames.has(normalizedName)) {
|
||||
continue;
|
||||
}
|
||||
existingNativeNames.add(normalizedName);
|
||||
nativeCommands.push(pluginCommand);
|
||||
}
|
||||
}
|
||||
|
||||
if (nativeCommands.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user