@kirigaya/openclaw-onebot 1.0.3 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,39 +1,56 @@
1
- # 发送消息(openclaw message send)
2
-
3
- 通过 OpenClaw 的 `openclaw message send` CLI 主动发送消息,由 Channel outbound 处理,无需 Agent 工具。
4
-
5
- ## 前置条件
6
-
7
- - Gateway 已启动:`openclaw gateway`
8
- - OneBot 渠道已配置并连接
9
-
10
- ## target 格式
11
-
12
- | 格式 | 说明 |
13
- |------|------|
14
- | `user:123456789` | 私聊该 QQ 号 |
15
- | `group:987654321` | 群聊该群号 |
16
- | `123456789` | 纯数字且 > 100000000 时按用户处理,否则按群处理 |
17
- | `onebot:group:xxx` / `qq:user:xxx` | 支持 onebot/qq/lagrange 前缀 |
18
-
19
- ## 发送文本
20
-
21
- ```bash
22
- openclaw message send --channel onebot --target user:1193466151 --message "你好"
23
- openclaw message send --channel onebot --target group:123456789 --message "群公告内容"
24
- ```
25
-
26
- ## 发送图片(mediaUrl)
27
-
28
- `--media` 支持 `file://` 路径、`http://` URL 或 `base64://`:
29
-
30
- ```bash
31
- openclaw message send --channel onebot --target user:1193466151 --media "file:///tmp/screenshot.png"
32
- openclaw message send --channel onebot --target group:123456789 --media "https://example.com/pic.jpg" --message "附带说明"
33
- ```
34
-
35
- ## 说明
36
-
37
- - **回复场景**(用户发消息 → Agent 回复):由 deliver 自动处理,Agent 输出 text/mediaUrl 即会送达
38
- - **主动发送**(CLI 或工作流):使用上述 `openclaw message send` 命令
39
- - 无 Agent 工具挂载,减少 token 消耗,提升扩展性
1
+ # 发送消息(openclaw message send)
2
+
3
+ 通过 OpenClaw 的 `openclaw message send` CLI 主动发送消息,由 Channel outbound 处理,无需 Agent 工具。
4
+
5
+ ## 前置条件
6
+
7
+ - Gateway 已启动:`openclaw gateway`
8
+ - OneBot 渠道已配置并连接
9
+
10
+ ## target 格式
11
+
12
+ | 格式 | 说明 |
13
+ |------|------|
14
+ | `user:123456789` | 私聊该 QQ 号 |
15
+ | `group:987654321` | 群聊该群号 |
16
+ | `123456789` | 纯数字且 > 100000000 时按用户处理,否则按群处理 |
17
+ | `onebot:group:xxx` / `qq:user:xxx` | 支持 onebot/qq/lagrange 前缀 |
18
+
19
+ ## 发送文本
20
+
21
+ ```bash
22
+ openclaw message send --channel onebot --target user:1193466151 --message "你好"
23
+ openclaw message send --channel onebot --target group:123456789 --message "群公告内容"
24
+ ```
25
+
26
+ ## 发送图片(mediaUrl)
27
+
28
+ `--media` 支持 `file://` 路径、`http://` URL 或 `base64://`:
29
+
30
+ ```bash
31
+ openclaw message send --channel onebot --target user:1193466151 --media "file:///tmp/screenshot.png"
32
+ openclaw message send --channel onebot --target group:123456789 --media "https://example.com/pic.jpg" --message "附带说明"
33
+ ```
34
+
35
+ ## 发送文件
36
+
37
+ 上传文件到群或私聊(区别于发送图片):
38
+
39
+ ```bash
40
+ openclaw onebot upload-file --target group:<群号> --file <本地绝对路径> --name <显示文件名>
41
+ openclaw onebot upload-file --target user:<QQ号> --file <本地绝对路径> --name <显示文件名>
42
+ ```
43
+
44
+ 示例:
45
+
46
+ ```bash
47
+ openclaw onebot upload-file --target group:123456789 --file /home/user/document.pdf --name "会议纪要.pdf"
48
+ openclaw onebot upload-file --target user:987654321 --file /tmp/report.xlsx --name "月度报表.xlsx"
49
+ ```
50
+
51
+ ## 说明
52
+
53
+ - **回复场景**(用户发消息 → Agent 回复):由 deliver 自动处理,Agent 输出 text/mediaUrl 即会送达
54
+ - **主动发送**(CLI 或工作流):使用上述 `openclaw message send` 命令
55
+ - **文件上传**:使用 `openclaw onebot upload-file`,适合发送文档等非图片文件
56
+ - 无 Agent 工具挂载,减少 token 消耗,提升扩展性