mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-19 07:42:04 +00:00
fix(cli): resolve message channel plugin scopes
This commit is contained in:
parent
0c305596a2
commit
5e49e8590d
7 changed files with 98 additions and 10 deletions
|
|
@ -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" };
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue