mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 16:00:43 +00:00
fix(cli): resolve message channel plugin scopes
This commit is contained in:
@@ -98,7 +98,7 @@ describe("runMessageAction", () => {
|
||||
|
||||
expect(ensurePluginRegistryLoaded).toHaveBeenCalledWith({
|
||||
scope: "configured-channels",
|
||||
onlyPluginIds: ["discord"],
|
||||
onlyChannelIds: ["discord"],
|
||||
});
|
||||
expect(exitMock).toHaveBeenCalledOnce();
|
||||
expect(exitMock).toHaveBeenCalledWith(0);
|
||||
@@ -117,7 +117,7 @@ describe("runMessageAction", () => {
|
||||
|
||||
expect(ensurePluginRegistryLoaded).toHaveBeenCalledWith({
|
||||
scope: "configured-channels",
|
||||
onlyPluginIds: ["telegram"],
|
||||
onlyChannelIds: ["telegram"],
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -34,14 +34,14 @@ async function runPluginStopHooks(): Promise<void> {
|
||||
|
||||
function resolveMessagePluginLoadOptions(
|
||||
opts: Record<string, unknown>,
|
||||
): { scope: PluginRegistryScope; onlyPluginIds?: string[] } | undefined {
|
||||
): { scope: PluginRegistryScope; onlyChannelIds?: string[] } | undefined {
|
||||
const scopedChannel = resolveMessageSecretScope({
|
||||
channel: opts.channel,
|
||||
target: opts.target,
|
||||
targets: opts.targets,
|
||||
}).channel;
|
||||
if (scopedChannel) {
|
||||
return { scope: "configured-channels", onlyPluginIds: [scopedChannel] };
|
||||
return { scope: "configured-channels", onlyChannelIds: [scopedChannel] };
|
||||
}
|
||||
return { scope: "configured-channels" };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user