mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-02 11:57:14 +00:00
chore: Lint extensions folder.
This commit is contained in:
@@ -62,7 +62,9 @@ export async function executeZalouserTool(
|
||||
throw new Error("threadId and message required for send action");
|
||||
}
|
||||
const args = ["msg", "send", params.threadId, params.message];
|
||||
if (params.isGroup) args.push("-g");
|
||||
if (params.isGroup) {
|
||||
args.push("-g");
|
||||
}
|
||||
const result = await runZca(args, { profile: params.profile });
|
||||
if (!result.ok) {
|
||||
throw new Error(result.stderr || "Failed to send message");
|
||||
@@ -78,8 +80,12 @@ export async function executeZalouserTool(
|
||||
throw new Error("url required for image action");
|
||||
}
|
||||
const args = ["msg", "image", params.threadId, "-u", params.url];
|
||||
if (params.message) args.push("-m", params.message);
|
||||
if (params.isGroup) args.push("-g");
|
||||
if (params.message) {
|
||||
args.push("-m", params.message);
|
||||
}
|
||||
if (params.isGroup) {
|
||||
args.push("-g");
|
||||
}
|
||||
const result = await runZca(args, { profile: params.profile });
|
||||
if (!result.ok) {
|
||||
throw new Error(result.stderr || "Failed to send image");
|
||||
@@ -92,7 +98,9 @@ export async function executeZalouserTool(
|
||||
throw new Error("threadId and url required for link action");
|
||||
}
|
||||
const args = ["msg", "link", params.threadId, params.url];
|
||||
if (params.isGroup) args.push("-g");
|
||||
if (params.isGroup) {
|
||||
args.push("-g");
|
||||
}
|
||||
const result = await runZca(args, { profile: params.profile });
|
||||
if (!result.ok) {
|
||||
throw new Error(result.stderr || "Failed to send link");
|
||||
@@ -142,10 +150,12 @@ export async function executeZalouserTool(
|
||||
});
|
||||
}
|
||||
|
||||
default:
|
||||
default: {
|
||||
params.action satisfies never;
|
||||
throw new Error(
|
||||
`Unknown action: ${params.action}. Valid actions: send, image, link, friends, groups, me, status`,
|
||||
`Unknown action: ${String(params.action)}. Valid actions: send, image, link, friends, groups, me, status`,
|
||||
);
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
return json({
|
||||
|
||||
Reference in New Issue
Block a user