@sliverp/qqbot 1.4.1 → 1.4.4
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.
- package/README.bak.md +261 -0
- package/README.md +87 -198
- package/README.zh.md +115 -0
- package/node_modules/silk-wasm/LICENSE +21 -0
- package/node_modules/silk-wasm/README.md +85 -0
- package/node_modules/silk-wasm/lib/index.cjs +16 -0
- package/node_modules/silk-wasm/lib/index.d.ts +70 -0
- package/node_modules/silk-wasm/lib/index.mjs +16 -0
- package/node_modules/silk-wasm/lib/silk.wasm +0 -0
- package/node_modules/silk-wasm/lib/utils.d.ts +4 -0
- package/node_modules/silk-wasm/package.json +39 -0
- package/package.json +18 -5
- package/skills/qqbot-cron/SKILL.md +490 -0
- package/skills/qqbot-media/SKILL.md +138 -0
- package/src/gateway.ts +71 -4
- package/src/utils/audio-convert.ts +138 -0
- package/dist/index.d.ts +0 -17
- package/dist/index.js +0 -22
- package/dist/src/api.d.ts +0 -194
- package/dist/src/api.js +0 -555
- package/dist/src/channel.d.ts +0 -3
- package/dist/src/channel.js +0 -281
- package/dist/src/config.d.ts +0 -25
- package/dist/src/config.js +0 -156
- package/dist/src/gateway.d.ts +0 -18
- package/dist/src/gateway.js +0 -1475
- package/dist/src/image-server.d.ts +0 -62
- package/dist/src/image-server.js +0 -401
- package/dist/src/known-users.d.ts +0 -100
- package/dist/src/known-users.js +0 -264
- package/dist/src/onboarding.d.ts +0 -10
- package/dist/src/onboarding.js +0 -195
- package/dist/src/outbound.d.ts +0 -149
- package/dist/src/outbound.js +0 -476
- package/dist/src/proactive.d.ts +0 -170
- package/dist/src/proactive.js +0 -398
- package/dist/src/runtime.d.ts +0 -3
- package/dist/src/runtime.js +0 -10
- package/dist/src/session-store.d.ts +0 -49
- package/dist/src/session-store.js +0 -242
- package/dist/src/types.d.ts +0 -116
- package/dist/src/types.js +0 -1
- package/dist/src/utils/image-size.d.ts +0 -51
- package/dist/src/utils/image-size.js +0 -234
- package/dist/src/utils/payload.d.ts +0 -112
- package/dist/src/utils/payload.js +0 -186
package/README.bak.md
ADDED
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# QQ Bot Channel Plugin for Openclaw(Clawdbot/Moltbot)
|
|
4
|
+
|
|
5
|
+
QQ 开放平台 Bot API 的 Openclaw 渠道插件,支持 C2C 私聊、群聊 @消息、频道消息。
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/@sliverp/qqbot)
|
|
8
|
+
[](./LICENSE)
|
|
9
|
+
[](https://bot.q.qq.com/wiki/)
|
|
10
|
+
[](https://github.com/sliverp/openclaw)
|
|
11
|
+
[](https://nodejs.org/)
|
|
12
|
+
[](https://www.typescriptlang.org/)
|
|
13
|
+
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## 📸 使用示例
|
|
20
|
+
<div align="center">
|
|
21
|
+
<img width="400" alt="使用示例" src="https://github.com/user-attachments/assets/6f1704ab-584b-497e-8937-96f84ce2958f" />
|
|
22
|
+
<img width="670" height="396" alt="Clipboard_Screenshot_1770366319" src="https://github.com/user-attachments/assets/e21e9292-fb93-41a7-81fe-39eeefe3b01d" />
|
|
23
|
+
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## ✨ 功能特性
|
|
29
|
+
|
|
30
|
+
- 🔒 **多场景支持** - C2C 私聊、群聊 @消息、频道消息、频道私信
|
|
31
|
+
- 🖼️ **富媒体消息** - 支持图片收发、文件发送
|
|
32
|
+
- ⏰ **定时推送** - 支持定时任务到时后主动推送
|
|
33
|
+
- 🔗 **URL 无限制** - 私聊可直接发送 URL
|
|
34
|
+
- ⌨️ **输入状态** - Bot 正在输入中状态提示
|
|
35
|
+
- 🔄 **热更新** - 支持 npm 方式安装和热更新
|
|
36
|
+
- 📝 **Markdown** - 支持 Markdown 格式
|
|
37
|
+
- 📝 **Command** - 支持Openclaw原生命令
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## ⭐ Star 趋势
|
|
43
|
+
<div align="center">
|
|
44
|
+
<img width="666" height="464" alt="star-history-202626 (1)" src="https://github.com/user-attachments/assets/01d123b4-f2a7-45b9-b2ed-b7a344497b4a" />
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
</div>
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## 📦 安装
|
|
53
|
+
|
|
54
|
+
### 方式一:腾讯云 Lighthouse 镜像(最简单)
|
|
55
|
+
|
|
56
|
+
[](https://cloud.tencent.com/product/lighthouse)
|
|
57
|
+
|
|
58
|
+
直接使用预装好的腾讯云 Lighthouse 镜像,开箱即用,无需手动安装配置。
|
|
59
|
+
|
|
60
|
+
### 方式二:npm 安装(推荐)
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
openclaw plugins install @sliverp/qqbot@1.3.7
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### 方式三:源码安装
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
git clone https://github.com/sliverp/qqbot.git && cd qqbot
|
|
70
|
+
clawdbot plugins install .
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
> 💡 安装过程需要一些时间,尤其是小内存机器,请耐心等待
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## ⚙️ 配置
|
|
78
|
+
|
|
79
|
+
### 1. 获取 QQ 机器人凭证
|
|
80
|
+
|
|
81
|
+
1. 访问 [QQ 开放平台](https://q.qq.com/)
|
|
82
|
+
2. 创建机器人应用
|
|
83
|
+
3. 获取 `AppID` 和 `AppSecret`(ClientSecret)
|
|
84
|
+
4. Token 格式:`AppID:AppSecret`
|
|
85
|
+
|
|
86
|
+
### 2. 添加配置
|
|
87
|
+
|
|
88
|
+
**交互式配置:**
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
clawdbot channels add
|
|
92
|
+
# 选择 qqbot,按提示输入 Token
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
**命令行配置:**
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
clawdbot channels add --channel qqbot --token "AppID:AppSecret"
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### 3. 手动编辑配置(可选)
|
|
102
|
+
|
|
103
|
+
编辑 `~/.clawdbot/clawdbot.json`:
|
|
104
|
+
|
|
105
|
+
```json
|
|
106
|
+
{
|
|
107
|
+
"channels": {
|
|
108
|
+
"qqbot": {
|
|
109
|
+
"enabled": true,
|
|
110
|
+
"appId": "你的AppID",
|
|
111
|
+
"clientSecret": "你的AppSecret"
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
## 🚀 使用
|
|
121
|
+
|
|
122
|
+
### 启动服务
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
# 后台启动
|
|
126
|
+
clawdbot gateway restart
|
|
127
|
+
|
|
128
|
+
# 前台启动(查看日志)
|
|
129
|
+
clawdbot gateway --port 18789 --verbose
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### CLI 配置向导
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
clawdbot onboard
|
|
136
|
+
# 选择 QQ Bot 进行交互式配置
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## ⚠️ 注意事项
|
|
142
|
+
|
|
143
|
+
- **群消息**:需要在群内 @机器人 才能触发回复
|
|
144
|
+
- **沙箱模式**:新创建的机器人默认在沙箱模式,需要添加测试用户
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## 🔄 升级
|
|
149
|
+
|
|
150
|
+
### npm 热更新
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
npx -y @sliverp/qqbot@1.3.7 upgrade
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
> 热更新后无需重新配置 AppId 和 AppSecret。该方式Openclaw和Node.js会占用大量内存,小内存机器优先建议使用源码方式热更新
|
|
157
|
+
|
|
158
|
+
### 源码热更新
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
git clone https://github.com/sliverp/qqbot.git && cd qqbot
|
|
162
|
+
|
|
163
|
+
# 运行升级脚本
|
|
164
|
+
bash ./scripts/upgrade.sh
|
|
165
|
+
|
|
166
|
+
# 重新安装
|
|
167
|
+
clawdbot plugins install .
|
|
168
|
+
|
|
169
|
+
# 重新配置
|
|
170
|
+
clawdbot channels add --channel qqbot --token "AppID:AppSecret"
|
|
171
|
+
|
|
172
|
+
# 重启网关
|
|
173
|
+
clawdbot gateway restart
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
升级脚本会自动清理旧版本和配置。
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## 📚 版本历史
|
|
184
|
+
|
|
185
|
+
<details>
|
|
186
|
+
<summary><b>v1.4.0</b></summary>
|
|
187
|
+
|
|
188
|
+
- 支持 Markdown 格式
|
|
189
|
+
|
|
190
|
+
</details>
|
|
191
|
+
|
|
192
|
+
<details>
|
|
193
|
+
<summary><b>v1.3.13 - 2026.02.06</b></summary>
|
|
194
|
+
|
|
195
|
+
- ✨ 支持Openclawd内置指令“/compact" , "/new"等(注意,/reset等命令有危险性,非常不建议把Bot拉入群聊)
|
|
196
|
+
- 🐛 修复在一些情况下”正在输入“不生效的问题
|
|
197
|
+
|
|
198
|
+
</details>
|
|
199
|
+
|
|
200
|
+
<details>
|
|
201
|
+
<summary><b>v1.3.0 - 2026.02.03</b></summary>
|
|
202
|
+
|
|
203
|
+
- ✨ 支持图片收发等功能
|
|
204
|
+
- ✨ 支持定时任务到时后主动推送
|
|
205
|
+
- ✨ 支持使用 npm 等方式安装和升级
|
|
206
|
+
- 🐛 优化一些已知问题
|
|
207
|
+
|
|
208
|
+
</details>
|
|
209
|
+
|
|
210
|
+
<details>
|
|
211
|
+
<summary><b>v1.2.5 - 2026.02.02</b></summary>
|
|
212
|
+
|
|
213
|
+
- ✨ 解除 URL 发送限制
|
|
214
|
+
- ✨ 更新 Bot 正在输入中状态
|
|
215
|
+
- ✨ 提供主动推送能力
|
|
216
|
+
- 🐛 优化一些已知问题
|
|
217
|
+
|
|
218
|
+
</details>
|
|
219
|
+
|
|
220
|
+
<details>
|
|
221
|
+
<summary><b>v1.2.2 - 2026.01.31</b></summary>
|
|
222
|
+
|
|
223
|
+
- ✨ 支持发送文件
|
|
224
|
+
- ✨ 支持 openclaw、moltbot 命令行
|
|
225
|
+
- 🐛 修复 health 检查提示问题
|
|
226
|
+
- 🐛 修复文件发送后 clawdbot 无法读取的问题
|
|
227
|
+
|
|
228
|
+
</details>
|
|
229
|
+
|
|
230
|
+
<details>
|
|
231
|
+
<summary><b>v1.2.1</b></summary>
|
|
232
|
+
|
|
233
|
+
- 🐛 解决长时间使用会断联的问题
|
|
234
|
+
- 🐛 解决频繁重连的问题
|
|
235
|
+
- ✨ 增加大模型调用失败后的提示消息
|
|
236
|
+
|
|
237
|
+
</details>
|
|
238
|
+
|
|
239
|
+
<details>
|
|
240
|
+
<summary><b>v1.1.0</b></summary>
|
|
241
|
+
|
|
242
|
+
- 🐛 解决 URL 被拦截的问题
|
|
243
|
+
- 🐛 解决多轮消息发送失败的问题
|
|
244
|
+
- 🐛 修复部分图片无法接收的问题
|
|
245
|
+
- ✨ 增加支持 onboard 配置方式
|
|
246
|
+
|
|
247
|
+
</details>
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
## 🔗 相关链接
|
|
252
|
+
|
|
253
|
+
- [QQ 机器人官方文档](https://bot.q.qq.com/wiki/)
|
|
254
|
+
- [QQ 开放平台](https://q.qq.com/)
|
|
255
|
+
- [API v2 文档](https://bot.q.qq.com/wiki/develop/api-v2/)
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
## 📄 License
|
|
260
|
+
|
|
261
|
+
MIT
|
package/README.md
CHANGED
|
@@ -1,267 +1,156 @@
|
|
|
1
|
-
|
|
1
|
+
# QQ
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
QQ is a widely-used instant messaging platform that provides various communication capabilities such as text, voice, images, and files. It supports collaborative scenarios like group chats and channels, making it suitable for both personal communication and team collaboration.
|
|
4
4
|
|
|
5
|
-
QQ
|
|
5
|
+
This integration method connects OpenClaw with a QQ Bot. It utilizes the platform's long-connection event subscription mechanism to receive message and event callbacks, enabling stable and secure message exchange and automation capability integration without exposing a public webhook address.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
[](./LICENSE)
|
|
9
|
-
[](https://bot.q.qq.com/wiki/)
|
|
10
|
-
[](https://github.com/sliverp/moltbot)
|
|
11
|
-
[](https://nodejs.org/)
|
|
12
|
-
[](https://www.typescriptlang.org/)
|
|
7
|
+
# Step 1: Install the QQ Bot Plugin
|
|
13
8
|
|
|
14
|
-
|
|
9
|
+
Install via the OpenClaw plugins command.
|
|
15
10
|
|
|
16
|
-
|
|
11
|
+
```
|
|
12
|
+
openclaw plugins install @sliverp/qqbot@latest
|
|
13
|
+
```
|
|
17
14
|
|
|
18
|
-
|
|
15
|
+
Install from source code:
|
|
19
16
|
|
|
20
|
-
|
|
17
|
+
```
|
|
18
|
+
git clone https://github.com/sliverp/qqbot.git && cd qqbot
|
|
19
|
+
openclaw plugins install .
|
|
20
|
+
```
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
# Step 2: Create a QQ Bot
|
|
23
23
|
|
|
24
|
-
##
|
|
24
|
+
## 1. Register on the QQ Open Platform
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
Go to the official website of the Tencent QQ Open Platform. You cannot log in directly with your personal QQ account by default; you need to register a new QQ Open Platform account.
|
|
27
|
+
<img width="2140" height="1004" alt="1" src="https://github.com/user-attachments/assets/d76a780c-5040-43fb-ac41-5808f975ae4b" />
|
|
27
28
|
|
|
28
|
-
|
|
29
|
+
After the initial registration, follow the platform's instructions to set up a super administrator.
|
|
29
30
|
|
|
30
|
-
|
|
31
|
+
<img width="2556" height="1744" alt="2" src="https://github.com/user-attachments/assets/ad0a54d5-6997-4f52-ae8f-bea71aa11c30" />
|
|
32
|
+
After successfully scanning the QR code with your mobile QQ, proceed to the next step to fill in the relevant entity information.
|
|
31
33
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
- ⏰ **定时推送** - 支持定时任务到时后主动推送
|
|
35
|
-
- 🔗 **URL 无限制** - 私聊可直接发送 URL
|
|
36
|
-
- ⌨️ **输入状态** - Bot 正在输入中状态提示
|
|
37
|
-
- 🔄 **热更新** - 支持 npm 方式安装和热更新
|
|
38
|
-
- 📝 **Markdown** - 支持 Markdown 格式(即将更新)
|
|
34
|
+
Using "Individual" as an example here, follow the prompts to enter your name, ID number, phone number, and verification code, then click continue to proceed to the facial recognition step.
|
|
35
|
+
<img width="2544" height="1744" alt="3" src="https://github.com/user-attachments/assets/b85c11f8-5627-4e08-b522-b38c4929bcb6" />
|
|
39
36
|
|
|
40
|
-
|
|
37
|
+
Use your mobile QQ to scan the QR code for facial recognition.
|
|
38
|
+
<img width="2542" height="1272" alt="4" src="https://github.com/user-attachments/assets/d0db5539-56ef-4189-930f-595348892bef" />
|
|
41
39
|
|
|
42
|
-
|
|
40
|
+
Once the facial recognition review is approved, you can log in to the QQ Open Platform.
|
|
41
|
+
<img width="2356" height="1308" alt="5" src="https://github.com/user-attachments/assets/c1875b27-fefc-4a1c-81ef-863da8b15ec6" />
|
|
43
42
|
|
|
44
|
-
|
|
43
|
+
## 2. Create a QQ Bot
|
|
45
44
|
|
|
46
|
-
|
|
45
|
+
On the QQ Open Platform's QQ Bot page, you can create a bot.
|
|
46
|
+
<img width="2334" height="1274" alt="6" src="https://github.com/user-attachments/assets/8389c38d-6662-46d0-ae04-92af374b61ef" />
|
|
47
|
+
<img width="2316" height="1258" alt="7" src="https://github.com/user-attachments/assets/15cfe57a-0404-4b02-85fe-42a22cf96d01" />
|
|
47
48
|
|
|
48
|
-
|
|
49
|
+
After the QQ Bot is created, you can select it and click to enter the management page.
|
|
50
|
+
<img width="3002" height="1536" alt="8" src="https://github.com/user-attachments/assets/7c0c7c69-29db-457f-974a-4aa52ebd7973" />
|
|
49
51
|
|
|
50
|
-
|
|
52
|
+
On the QQ Bot management page, obtain the current bot's AppID and AppSecret, copy them, and save them to your personal notepad or memo (please ensure data security and do not leak them). They will be needed later in "Step 3: Configuring OpenClaw".
|
|
51
53
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
54
|
+
Note: For security reasons, the QQ Bot's AppSecret is not stored in plain text. If you view it for the first time or forget it, you need to regenerate it.
|
|
55
|
+
<img width="2970" height="1562" alt="9" src="https://github.com/user-attachments/assets/c7fc3094-2840-4780-a202-47b2c2b74e50" />
|
|
56
|
+
<img width="1258" height="594" alt="10" src="https://github.com/user-attachments/assets/4445bede-e7d5-4927-9821-039e7ad8f1f5" />
|
|
55
57
|
|
|
56
|
-
|
|
58
|
+
## 3. Sandbox Configuration
|
|
57
59
|
|
|
58
|
-
|
|
59
|
-
git clone https://github.com/sliverp/qqbot.git && cd qqbot
|
|
60
|
-
clawdbot plugins install .
|
|
61
|
-
```
|
|
60
|
+
On the QQ Bot's "Development Management" page, in the "Sandbox Configuration" section, set up private chat (select "Configure in Message List").
|
|
62
61
|
|
|
63
|
-
|
|
62
|
+
You can configure this according to your own usage scenario, or you can complete the subsequent steps and then return to this step to operate.
|
|
64
63
|
|
|
65
|
-
|
|
64
|
+
⚠️ Note:
|
|
65
|
+
The QQ Bot created here does not need to be published and made available to all QQ users. It can be used for personal (sandbox) debugging and experience.
|
|
66
|
+
The QQ Open Platform does not support "Configuration in QQ Groups" for bots; it only supports private chat with the QQ Bot.
|
|
67
|
+
<img width="1904" height="801" alt="11" src="https://github.com/user-attachments/assets/f3940a87-aae7-4c89-8f9a-c94fb52cd3ea" />
|
|
66
68
|
|
|
67
|
-
|
|
69
|
+
Note: When selecting "Configure in Message List", you need to first add members, and then use the QQ scan code of that member to add the bot.
|
|
70
|
+
<img width="2582" height="484" alt="12" src="https://github.com/user-attachments/assets/5631fe76-2205-4b1e-b463-75fa3a397464" />
|
|
71
|
+
Note here that after successfully adding a member, you still need to use QQ scan code to add the bot.
|
|
68
72
|
|
|
69
|
-
|
|
73
|
+
<img width="2286" height="1324" alt="13" src="https://github.com/user-attachments/assets/cbf379be-ef6e-4391-8cb1-67c08aad2d43" />
|
|
74
|
+
At this point, after adding the bot to your QQ account, you still cannot have a normal conversation with it. You will receive a prompt saying "The bot has gone to Mars, please try again later." This is because the QQ bot has not yet been connected to the OpenClaw application.
|
|
70
75
|
|
|
71
|
-
|
|
72
|
-
2. 创建机器人应用
|
|
73
|
-
3. 获取 `AppID` 和 `AppSecret`(ClientSecret)
|
|
74
|
-
4. Token 格式:`AppID:AppSecret`
|
|
76
|
+
You need to proceed with the following steps to configure the QQ bot's AppID and AppSecret for the OpenClaw application.
|
|
75
77
|
|
|
76
|
-
|
|
78
|
+
<img width="872" height="1052" alt="14" src="https://github.com/user-attachments/assets/0c02aaf6-6cf9-419c-a6ab-36398d73c5ba" />
|
|
77
79
|
|
|
78
|
-
|
|
80
|
+
(Optional) You can also add more members by referring to the previous steps: First, add a new member in the member management page, then add the member in the sandbox configuration page. After that, the new member can add this QQ bot by scanning the QR code with QQ.
|
|
81
|
+
<img width="3006" height="1504" alt="15" src="https://github.com/user-attachments/assets/cecef3a6-0596-4da0-8b92-8d67b8f3cdca" />
|
|
82
|
+
<img width="2902" height="1394" alt="16" src="https://github.com/user-attachments/assets/eb98ffce-490f-402c-8b0c-af7ede1b1303" />
|
|
83
|
+
<img width="1306" height="672" alt="17" src="https://github.com/user-attachments/assets/799056e3-82a6-44bc-9e3d-9c840faafa41" />
|
|
79
84
|
|
|
80
|
-
|
|
81
|
-
clawdbot channels add
|
|
82
|
-
# 选择 qqbot,按提示输入 Token
|
|
83
|
-
```
|
|
85
|
+
# Step 3: Configure OpenClaw
|
|
84
86
|
|
|
85
|
-
|
|
87
|
+
## Method 1: Configure via Wizard (Recommended)
|
|
88
|
+
|
|
89
|
+
Add the qqbot channel and input the AppID and AppSecret obtained in Step 2.
|
|
86
90
|
|
|
87
|
-
```
|
|
88
|
-
|
|
91
|
+
```
|
|
92
|
+
openclaw channels add --channel qqbot --token "AppID:AppSecret"
|
|
89
93
|
```
|
|
90
94
|
|
|
91
|
-
|
|
95
|
+
## Method 2: Configure via Configuration File
|
|
92
96
|
|
|
93
|
-
|
|
97
|
+
Edit ~/.openclaw/openclaw.json:
|
|
94
98
|
|
|
95
|
-
```json
|
|
99
|
+
``` json
|
|
96
100
|
{
|
|
97
101
|
"channels": {
|
|
98
102
|
"qqbot": {
|
|
99
103
|
"enabled": true,
|
|
100
|
-
"appId": "
|
|
101
|
-
"clientSecret": "
|
|
104
|
+
"appId": "Your AppID",
|
|
105
|
+
"clientSecret": "Your AppSecret"
|
|
102
106
|
}
|
|
103
107
|
}
|
|
104
108
|
}
|
|
105
109
|
```
|
|
106
110
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
## 📋 配置项说明
|
|
110
|
-
|
|
111
|
-
| 配置项 | 类型 | 必填 | 说明 |
|
|
112
|
-
|--------|------|------|------|
|
|
113
|
-
| `appId` | string | ✅ | QQ 机器人 AppID |
|
|
114
|
-
| `clientSecret` | string | ✅* | AppSecret,与 `clientSecretFile` 二选一 |
|
|
115
|
-
| `clientSecretFile` | string | ✅* | AppSecret 文件路径 |
|
|
116
|
-
| `enabled` | boolean | ❌ | 是否启用,默认 `true` |
|
|
117
|
-
| `name` | string | ❌ | 账户显示名称 |
|
|
118
|
-
| `systemPrompt` | string | ❌ | 自定义系统提示词 |
|
|
111
|
+
# Step 4: Start and Test
|
|
119
112
|
|
|
120
|
-
|
|
113
|
+
## 1. Start the gateway
|
|
121
114
|
|
|
122
|
-
## 📨 支持的消息类型
|
|
123
|
-
|
|
124
|
-
| 事件类型 | 说明 | Intent |
|
|
125
|
-
|----------|------|--------|
|
|
126
|
-
| `C2C_MESSAGE_CREATE` | C2C 单聊消息 | `1 << 25` |
|
|
127
|
-
| `GROUP_AT_MESSAGE_CREATE` | 群聊 @机器人消息 | `1 << 25` |
|
|
128
|
-
| `AT_MESSAGE_CREATE` | 频道 @机器人消息 | `1 << 30` |
|
|
129
|
-
| `DIRECT_MESSAGE_CREATE` | 频道私信 | `1 << 12` |
|
|
130
|
-
|
|
131
|
-
---
|
|
132
|
-
|
|
133
|
-
## 🚀 使用
|
|
134
|
-
|
|
135
|
-
### 启动服务
|
|
136
|
-
|
|
137
|
-
```bash
|
|
138
|
-
# 后台启动
|
|
139
|
-
clawdbot gateway restart
|
|
140
|
-
|
|
141
|
-
# 前台启动(查看日志)
|
|
142
|
-
clawdbot gateway --port 18789 --verbose
|
|
143
115
|
```
|
|
144
|
-
|
|
145
|
-
### CLI 配置向导
|
|
146
|
-
|
|
147
|
-
```bash
|
|
148
|
-
clawdbot onboard
|
|
149
|
-
# 选择 QQ Bot 进行交互式配置
|
|
116
|
+
openclaw gateway
|
|
150
117
|
```
|
|
151
118
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
## ⚠️ 注意事项
|
|
119
|
+
## 2. Chat with the QQbot in QQ
|
|
155
120
|
|
|
156
|
-
|
|
157
|
-
- **沙箱模式**:新创建的机器人默认在沙箱模式,需要添加测试用户
|
|
121
|
+
<img width="990" height="984" alt="18" src="https://github.com/user-attachments/assets/b2776c8b-de72-4e37-b34d-e8287ce45de1" />
|
|
158
122
|
|
|
159
|
-
---
|
|
160
123
|
|
|
161
|
-
|
|
124
|
+
# Upgrade
|
|
125
|
+
## Using openclaw/npm(Recommendation)
|
|
162
126
|
|
|
163
|
-
|
|
127
|
+
> only for installed by`openclaw plugins install`
|
|
164
128
|
|
|
165
|
-
```
|
|
166
|
-
|
|
129
|
+
```
|
|
130
|
+
openclaw plugins upgrade @sliverp/qqbot@latest
|
|
167
131
|
```
|
|
168
132
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
133
|
+
## Using npx
|
|
134
|
+
```
|
|
135
|
+
npx -y @sliverp/qqbot@latest upgrade
|
|
136
|
+
```
|
|
172
137
|
|
|
173
|
-
|
|
138
|
+
## Using resource code
|
|
139
|
+
```
|
|
174
140
|
git clone https://github.com/sliverp/qqbot.git && cd qqbot
|
|
175
141
|
|
|
176
|
-
#
|
|
142
|
+
# run upgrade script
|
|
177
143
|
bash ./scripts/upgrade.sh
|
|
178
144
|
|
|
179
|
-
#
|
|
145
|
+
# re-install
|
|
180
146
|
clawdbot plugins install .
|
|
181
147
|
|
|
182
|
-
#
|
|
148
|
+
# re-config
|
|
183
149
|
clawdbot channels add --channel qqbot --token "AppID:AppSecret"
|
|
184
150
|
|
|
185
|
-
#
|
|
151
|
+
# restart gateway
|
|
186
152
|
clawdbot gateway restart
|
|
187
153
|
```
|
|
188
154
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
---
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
---
|
|
196
|
-
|
|
197
|
-
## 📚 版本历史
|
|
198
|
-
|
|
199
|
-
<details>
|
|
200
|
-
<summary><b>v1.4.0(即将更新)</b></summary>
|
|
201
|
-
|
|
202
|
-
- 支持 Markdown 格式
|
|
203
|
-
|
|
204
|
-
</details>
|
|
205
|
-
|
|
206
|
-
<details>
|
|
207
|
-
<summary><b>v1.3.0 - 2026.02.03</b></summary>
|
|
208
|
-
|
|
209
|
-
- ✨ 支持图片收发等功能
|
|
210
|
-
- ✨ 支持定时任务到时后主动推送
|
|
211
|
-
- ✨ 支持使用 npm 等方式安装和升级
|
|
212
|
-
- 🐛 优化一些已知问题
|
|
213
|
-
|
|
214
|
-
</details>
|
|
215
|
-
|
|
216
|
-
<details>
|
|
217
|
-
<summary><b>v1.2.5 - 2026.02.02</b></summary>
|
|
218
|
-
|
|
219
|
-
- ✨ 解除 URL 发送限制
|
|
220
|
-
- ✨ 更新 Bot 正在输入中状态
|
|
221
|
-
- ✨ 提供主动推送能力
|
|
222
|
-
- 🐛 优化一些已知问题
|
|
223
|
-
|
|
224
|
-
</details>
|
|
225
|
-
|
|
226
|
-
<details>
|
|
227
|
-
<summary><b>v1.2.2 - 2026.01.31</b></summary>
|
|
228
|
-
|
|
229
|
-
- ✨ 支持发送文件
|
|
230
|
-
- ✨ 支持 openclaw、moltbot 命令行
|
|
231
|
-
- 🐛 修复 health 检查提示问题
|
|
232
|
-
- 🐛 修复文件发送后 clawdbot 无法读取的问题
|
|
233
|
-
|
|
234
|
-
</details>
|
|
235
|
-
|
|
236
|
-
<details>
|
|
237
|
-
<summary><b>v1.2.1</b></summary>
|
|
238
|
-
|
|
239
|
-
- 🐛 解决长时间使用会断联的问题
|
|
240
|
-
- 🐛 解决频繁重连的问题
|
|
241
|
-
- ✨ 增加大模型调用失败后的提示消息
|
|
242
|
-
|
|
243
|
-
</details>
|
|
244
|
-
|
|
245
|
-
<details>
|
|
246
|
-
<summary><b>v1.1.0</b></summary>
|
|
247
|
-
|
|
248
|
-
- 🐛 解决 URL 被拦截的问题
|
|
249
|
-
- 🐛 解决多轮消息发送失败的问题
|
|
250
|
-
- 🐛 修复部分图片无法接收的问题
|
|
251
|
-
- ✨ 增加支持 onboard 配置方式
|
|
252
|
-
|
|
253
|
-
</details>
|
|
254
|
-
|
|
255
|
-
---
|
|
256
|
-
|
|
257
|
-
## 🔗 相关链接
|
|
258
|
-
|
|
259
|
-
- [QQ 机器人官方文档](https://bot.q.qq.com/wiki/)
|
|
260
|
-
- [QQ 开放平台](https://q.qq.com/)
|
|
261
|
-
- [API v2 文档](https://bot.q.qq.com/wiki/develop/api-v2/)
|
|
262
|
-
|
|
263
|
-
---
|
|
264
|
-
|
|
265
|
-
## 📄 License
|
|
266
|
-
|
|
267
|
-
MIT
|
|
155
|
+
# Other Language README
|
|
156
|
+
[简体中文](README.zh.md)
|