zalo-multi-send
Send multiple attachments in one Zalo message via scripts/send.mjs.
Usage
CODEBLOCK0
Parameters
| Flag | Required | Description |
|---|
| INLINECODE1 | ✅ | Zalo user ID or group ID (numeric string) |
| INLINECODE2 |
✅ | Comma-separated local paths or https:// URLs |
|
--caption | ❌ | Text message to send alongside the files |
|
--group | ❌ | Add this flag if
--to is a group ID |
|
--profile | ❌ | Credential profile name (default:
"default") |
Examples
CODEBLOCK1
Notes
- - Credentials are read from
~/.openclaw/credentials/zalouser/credentials.json (managed by openclaw, no re-auth needed) - ZCA_PATH is hardcoded to the openclaw-bundled zca-js. If openclaw is updated/reinstalled, the path may need updating in INLINECODE9
- Local files must be readable by the current user
- Zalo may have undocumented limits on number of attachments per message (tested up to ~10 without issues)
- Exit 0 = success, exit 1 = error
zalo-multi-send
通过 scripts/send.mjs 在一条 Zalo 消息中发送多个附件。
使用方法
bash
node <技能目录>/scripts/send.mjs \
--to <用户ID或群组ID> \
--files <路径或URL1>,<路径或URL2>,... \
[--caption 可选文本] \
[--group] \
[--profile default]
参数
| 标志 | 必需 | 描述 |
|---|
| --to | ✅ | Zalo 用户 ID 或群组 ID(数字字符串) |
| --files |
✅ | 逗号分隔的本地路径或 https:// 链接 |
| --caption | ❌ | 随附件一起发送的文本消息 |
| --group | ❌ | 如果 --to 是群组 ID,请添加此标志 |
| --profile | ❌ | 凭证配置文件名称(默认值:default) |
示例
bash
向用户发送 2 张本地截图
node scripts/send.mjs \
--to 3484584962870495768 \
--files /home/tuan/Pictures/Screenshots/shot1.png,/home/tuan/Pictures/Screenshots/shot2.png
从 URL 发送带说明的图片
node scripts/send.mjs \
--to 3484584962870495768 \
--files https://files.catbox.moe/abc.png,https://files.catbox.moe/def.png \
--caption Đây nhé!
发送到群组
node scripts/send.mjs \
--to 1234567890 \
--group \
--files photo1.jpg,photo2.jpg
注意事项
- - 凭证从 ~/.openclaw/credentials/zalouser/credentials.json 读取(由 openclaw 管理,无需重新认证)
- ZCA_PATH 硬编码为 openclaw 捆绑的 zca-js。如果 openclaw 更新或重新安装,可能需要在 scripts/send.mjs 中更新路径
- 本地文件必须对当前用户可读
- Zalo 可能对每条消息的附件数量有未记录的限���(测试过约 10 个附件无问题)
- 退出码 0 = 成功,退出码 1 = 错误