@ryantest/openclaw-qqbot 0.0.1
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/LICENSE +22 -0
- package/README.md +483 -0
- package/README.zh.md +478 -0
- package/bin/qqbot-cli.js +243 -0
- package/clawdbot.plugin.json +16 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +26 -0
- package/dist/src/admin-resolver.d.ts +27 -0
- package/dist/src/admin-resolver.js +122 -0
- package/dist/src/api.d.ts +156 -0
- package/dist/src/api.js +599 -0
- package/dist/src/channel.d.ts +11 -0
- package/dist/src/channel.js +354 -0
- package/dist/src/config.d.ts +25 -0
- package/dist/src/config.js +161 -0
- package/dist/src/credential-backup.d.ts +31 -0
- package/dist/src/credential-backup.js +66 -0
- package/dist/src/gateway.d.ts +18 -0
- package/dist/src/gateway.js +1265 -0
- package/dist/src/image-server.d.ts +68 -0
- package/dist/src/image-server.js +462 -0
- package/dist/src/inbound-attachments.d.ts +58 -0
- package/dist/src/inbound-attachments.js +234 -0
- package/dist/src/known-users.d.ts +100 -0
- package/dist/src/known-users.js +263 -0
- package/dist/src/message-queue.d.ts +50 -0
- package/dist/src/message-queue.js +115 -0
- package/dist/src/onboarding.d.ts +10 -0
- package/dist/src/onboarding.js +203 -0
- package/dist/src/outbound-deliver.d.ts +48 -0
- package/dist/src/outbound-deliver.js +462 -0
- package/dist/src/outbound.d.ts +203 -0
- package/dist/src/outbound.js +1102 -0
- package/dist/src/proactive.d.ts +170 -0
- package/dist/src/proactive.js +399 -0
- package/dist/src/ref-index-store.d.ts +70 -0
- package/dist/src/ref-index-store.js +273 -0
- package/dist/src/reply-dispatcher.d.ts +35 -0
- package/dist/src/reply-dispatcher.js +311 -0
- package/dist/src/runtime.d.ts +3 -0
- package/dist/src/runtime.js +10 -0
- package/dist/src/session-store.d.ts +52 -0
- package/dist/src/session-store.js +254 -0
- package/dist/src/slash-commands.d.ts +71 -0
- package/dist/src/slash-commands.js +1179 -0
- package/dist/src/startup-greeting.d.ts +30 -0
- package/dist/src/startup-greeting.js +78 -0
- package/dist/src/stt.d.ts +21 -0
- package/dist/src/stt.js +70 -0
- package/dist/src/tools/channel.d.ts +16 -0
- package/dist/src/tools/channel.js +234 -0
- package/dist/src/tools/remind.d.ts +2 -0
- package/dist/src/tools/remind.js +247 -0
- package/dist/src/types.d.ts +175 -0
- package/dist/src/types.js +1 -0
- package/dist/src/typing-keepalive.d.ts +27 -0
- package/dist/src/typing-keepalive.js +64 -0
- package/dist/src/update-checker.d.ts +34 -0
- package/dist/src/update-checker.js +166 -0
- package/dist/src/user-messages.d.ts +8 -0
- package/dist/src/user-messages.js +8 -0
- package/dist/src/utils/audio-convert.d.ts +89 -0
- package/dist/src/utils/audio-convert.js +704 -0
- package/dist/src/utils/file-utils.d.ts +55 -0
- package/dist/src/utils/file-utils.js +150 -0
- package/dist/src/utils/image-size.d.ts +51 -0
- package/dist/src/utils/image-size.js +234 -0
- package/dist/src/utils/media-tags.d.ts +14 -0
- package/dist/src/utils/media-tags.js +164 -0
- package/dist/src/utils/payload.d.ts +112 -0
- package/dist/src/utils/payload.js +186 -0
- package/dist/src/utils/platform.d.ts +137 -0
- package/dist/src/utils/platform.js +390 -0
- package/dist/src/utils/text-parsing.d.ts +32 -0
- package/dist/src/utils/text-parsing.js +80 -0
- package/dist/src/utils/upload-cache.d.ts +34 -0
- package/dist/src/utils/upload-cache.js +93 -0
- package/index.ts +31 -0
- package/moltbot.plugin.json +16 -0
- package/node_modules/@eshaz/web-worker/LICENSE +201 -0
- package/node_modules/@eshaz/web-worker/README.md +134 -0
- package/node_modules/@eshaz/web-worker/browser.js +17 -0
- package/node_modules/@eshaz/web-worker/cjs/browser.js +16 -0
- package/node_modules/@eshaz/web-worker/cjs/node.js +219 -0
- package/node_modules/@eshaz/web-worker/index.d.ts +4 -0
- package/node_modules/@eshaz/web-worker/node.js +223 -0
- package/node_modules/@eshaz/web-worker/package.json +54 -0
- package/node_modules/@wasm-audio-decoders/common/index.js +5 -0
- package/node_modules/@wasm-audio-decoders/common/package.json +36 -0
- package/node_modules/@wasm-audio-decoders/common/src/WASMAudioDecoderCommon.js +231 -0
- package/node_modules/@wasm-audio-decoders/common/src/WASMAudioDecoderWorker.js +129 -0
- package/node_modules/@wasm-audio-decoders/common/src/puff/README +67 -0
- package/node_modules/@wasm-audio-decoders/common/src/puff/build_puff.js +31 -0
- package/node_modules/@wasm-audio-decoders/common/src/puff/puff.c +863 -0
- package/node_modules/@wasm-audio-decoders/common/src/puff/puff.h +35 -0
- package/node_modules/@wasm-audio-decoders/common/src/utilities.js +3 -0
- package/node_modules/@wasm-audio-decoders/common/types.d.ts +7 -0
- package/node_modules/mpg123-decoder/README.md +265 -0
- package/node_modules/mpg123-decoder/dist/mpg123-decoder.min.js +185 -0
- package/node_modules/mpg123-decoder/dist/mpg123-decoder.min.js.map +1 -0
- package/node_modules/mpg123-decoder/index.js +8 -0
- package/node_modules/mpg123-decoder/package.json +58 -0
- package/node_modules/mpg123-decoder/src/EmscriptenWasm.js +464 -0
- package/node_modules/mpg123-decoder/src/MPEGDecoder.js +200 -0
- package/node_modules/mpg123-decoder/src/MPEGDecoderWebWorker.js +21 -0
- package/node_modules/mpg123-decoder/types.d.ts +30 -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/node_modules/simple-yenc/.github/FUNDING.yml +1 -0
- package/node_modules/simple-yenc/.prettierignore +1 -0
- package/node_modules/simple-yenc/LICENSE +7 -0
- package/node_modules/simple-yenc/README.md +163 -0
- package/node_modules/simple-yenc/dist/esm.js +1 -0
- package/node_modules/simple-yenc/dist/index.js +1 -0
- package/node_modules/simple-yenc/package.json +50 -0
- package/node_modules/simple-yenc/rollup.config.js +27 -0
- package/node_modules/simple-yenc/src/simple-yenc.js +302 -0
- package/node_modules/ws/LICENSE +20 -0
- package/node_modules/ws/README.md +548 -0
- package/node_modules/ws/browser.js +8 -0
- package/node_modules/ws/index.js +13 -0
- package/node_modules/ws/lib/buffer-util.js +131 -0
- package/node_modules/ws/lib/constants.js +19 -0
- package/node_modules/ws/lib/event-target.js +292 -0
- package/node_modules/ws/lib/extension.js +203 -0
- package/node_modules/ws/lib/limiter.js +55 -0
- package/node_modules/ws/lib/permessage-deflate.js +528 -0
- package/node_modules/ws/lib/receiver.js +706 -0
- package/node_modules/ws/lib/sender.js +602 -0
- package/node_modules/ws/lib/stream.js +161 -0
- package/node_modules/ws/lib/subprotocol.js +62 -0
- package/node_modules/ws/lib/validation.js +152 -0
- package/node_modules/ws/lib/websocket-server.js +554 -0
- package/node_modules/ws/lib/websocket.js +1393 -0
- package/node_modules/ws/package.json +69 -0
- package/node_modules/ws/wrapper.mjs +8 -0
- package/openclaw.plugin.json +16 -0
- package/package.json +76 -0
- package/scripts/cleanup-legacy-plugins.sh +124 -0
- package/scripts/proactive-api-server.ts +369 -0
- package/scripts/send-proactive.ts +293 -0
- package/scripts/set-markdown.sh +156 -0
- package/scripts/test-sendmedia.ts +116 -0
- package/scripts/upgrade-via-alt-pkg.sh +307 -0
- package/scripts/upgrade-via-npm.ps1 +296 -0
- package/scripts/upgrade-via-npm.sh +301 -0
- package/scripts/upgrade-via-source.sh +774 -0
- package/skills/qqbot-channel/SKILL.md +263 -0
- package/skills/qqbot-channel/references/api_references.md +521 -0
- package/skills/qqbot-media/SKILL.md +56 -0
- package/skills/qqbot-remind/SKILL.md +149 -0
- package/src/admin-resolver.ts +140 -0
- package/src/api.ts +819 -0
- package/src/bot-logs-2026-03-21T11-21-47(2).txt +46 -0
- package/src/channel.ts +381 -0
- package/src/config.ts +187 -0
- package/src/credential-backup.ts +72 -0
- package/src/gateway.log +43 -0
- package/src/gateway.ts +1404 -0
- package/src/image-server.ts +539 -0
- package/src/inbound-attachments.ts +304 -0
- package/src/known-users.ts +353 -0
- package/src/message-queue.ts +169 -0
- package/src/onboarding.ts +274 -0
- package/src/openclaw-2026-03-21.log +3729 -0
- package/src/openclaw-plugin-sdk.d.ts +522 -0
- package/src/outbound-deliver.ts +552 -0
- package/src/outbound.ts +1266 -0
- package/src/proactive.ts +530 -0
- package/src/ref-index-store.ts +357 -0
- package/src/reply-dispatcher.ts +334 -0
- package/src/runtime.ts +14 -0
- package/src/session-store.ts +303 -0
- package/src/slash-commands.ts +1305 -0
- package/src/startup-greeting.ts +98 -0
- package/src/stt.ts +86 -0
- package/src/tools/channel.ts +281 -0
- package/src/tools/remind.ts +296 -0
- package/src/types.ts +183 -0
- package/src/typing-keepalive.ts +59 -0
- package/src/update-checker.ts +179 -0
- package/src/user-messages.ts +7 -0
- package/src/utils/audio-convert.ts +803 -0
- package/src/utils/file-utils.ts +167 -0
- package/src/utils/image-size.ts +266 -0
- package/src/utils/media-tags.ts +182 -0
- package/src/utils/payload.ts +265 -0
- package/src/utils/platform.ts +435 -0
- package/src/utils/text-parsing.ts +82 -0
- package/src/utils/upload-cache.ts +128 -0
- package/tsconfig.json +16 -0
|
@@ -0,0 +1,521 @@
|
|
|
1
|
+
# QQ 频道 API 完整参考
|
|
2
|
+
|
|
3
|
+
本文档包含 QQ 开放平台频道相关所有接口的详细参数说明、返回值结构和枚举值定义。
|
|
4
|
+
|
|
5
|
+
通过 `qqbot_channel_api` 工具代理请求,工具自动处理鉴权。
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 📌 通用说明
|
|
10
|
+
|
|
11
|
+
### 基础 URL
|
|
12
|
+
|
|
13
|
+
`https://api.sgroup.qq.com`
|
|
14
|
+
|
|
15
|
+
### 鉴权(自动处理)
|
|
16
|
+
|
|
17
|
+
工具自动填充以下请求头,无需手动设置:
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
Authorization: QQBot {access_token}
|
|
21
|
+
Content-Type: application/json
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### 错误返回格式
|
|
25
|
+
|
|
26
|
+
```json
|
|
27
|
+
{
|
|
28
|
+
"message": "错误描述",
|
|
29
|
+
"code": 错误码
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 📦 返回值类型定义
|
|
36
|
+
|
|
37
|
+
### Guild(频道)
|
|
38
|
+
|
|
39
|
+
```typescript
|
|
40
|
+
interface Guild {
|
|
41
|
+
id: string; // 频道 ID
|
|
42
|
+
name: string; // 频道名称
|
|
43
|
+
icon: string; // 频道头像 URL
|
|
44
|
+
owner_id: string; // 频道拥有者 ID
|
|
45
|
+
owner: boolean; // 机器人是否为频道拥有者
|
|
46
|
+
joined_at: string; // 机器人加入时间(ISO 8601)
|
|
47
|
+
member_count: number; // 频道成员数
|
|
48
|
+
max_members: number; // 频道最大成员数
|
|
49
|
+
description: string; // 频道描述
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Channel(子频道)
|
|
54
|
+
|
|
55
|
+
```typescript
|
|
56
|
+
interface Channel {
|
|
57
|
+
id: string; // 子频道 ID
|
|
58
|
+
guild_id: string; // 所属频道 ID
|
|
59
|
+
name: string; // 子频道名称
|
|
60
|
+
type: number; // 子频道类型(见枚举)
|
|
61
|
+
position: number; // 排序位置
|
|
62
|
+
parent_id: string; // 所属分组 ID
|
|
63
|
+
owner_id: string; // 创建者 ID
|
|
64
|
+
sub_type: number; // 子类型(见枚举)
|
|
65
|
+
private_type?: number; // 私密类型(见枚举)
|
|
66
|
+
speak_permission?: number; // 发言权限(见枚举)
|
|
67
|
+
application_id?: string; // 应用子频道 AppID
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### User(用户)
|
|
72
|
+
|
|
73
|
+
```typescript
|
|
74
|
+
interface User {
|
|
75
|
+
id: string; // 用户 ID
|
|
76
|
+
username: string; // 用户名
|
|
77
|
+
avatar: string; // 头像 URL
|
|
78
|
+
bot: boolean; // 是否为机器人
|
|
79
|
+
union_openid?: string; // 特殊关联应用的 openid
|
|
80
|
+
union_user_account?: string; // 特殊关联应用的用户信息
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Member(成员)
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
interface Member {
|
|
88
|
+
user: User; // 用户基本信息
|
|
89
|
+
nick: string; // 在频道中的昵称
|
|
90
|
+
roles: string[]; // 身份组 ID 列表
|
|
91
|
+
joined_at: string; // 加入频道时间(ISO 8601)
|
|
92
|
+
deaf?: boolean; // 是否被禁言
|
|
93
|
+
mute?: boolean; // 是否被闭麦
|
|
94
|
+
pending?: boolean; // 是否待审核
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### APIPermission(API 权限)
|
|
99
|
+
|
|
100
|
+
```typescript
|
|
101
|
+
interface APIPermission {
|
|
102
|
+
path: string; // 接口路径
|
|
103
|
+
method: string; // 请求方法
|
|
104
|
+
desc: string; // 接口描述
|
|
105
|
+
auth_status: number; // 授权状态:0=未授权, 1=已授权
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### AnnouncesResult(公告结果)
|
|
110
|
+
|
|
111
|
+
```typescript
|
|
112
|
+
interface AnnouncesResult {
|
|
113
|
+
guild_id: string;
|
|
114
|
+
channel_id: string;
|
|
115
|
+
message_id: string;
|
|
116
|
+
announces_type: number;
|
|
117
|
+
recommend_channels: RecommendChannel[];
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
interface RecommendChannel {
|
|
121
|
+
channel_id: string; // 推荐的子频道 ID
|
|
122
|
+
introduce: string; // 推荐语
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### ThreadDetail(帖子详情)
|
|
127
|
+
|
|
128
|
+
```typescript
|
|
129
|
+
interface ThreadDetail {
|
|
130
|
+
thread: {
|
|
131
|
+
guild_id: string;
|
|
132
|
+
channel_id: string;
|
|
133
|
+
author_id: string;
|
|
134
|
+
thread_info: {
|
|
135
|
+
thread_id: string;
|
|
136
|
+
title: string;
|
|
137
|
+
content: string;
|
|
138
|
+
date_time: string;
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### ThreadListResult(帖子列表)
|
|
145
|
+
|
|
146
|
+
```typescript
|
|
147
|
+
interface ThreadListResult {
|
|
148
|
+
threads: Array<{
|
|
149
|
+
guild_id: string;
|
|
150
|
+
channel_id: string;
|
|
151
|
+
author_id: string;
|
|
152
|
+
thread_info: {
|
|
153
|
+
thread_id: string;
|
|
154
|
+
title: string;
|
|
155
|
+
content: string;
|
|
156
|
+
date_time: string;
|
|
157
|
+
};
|
|
158
|
+
}>;
|
|
159
|
+
is_finish: number; // 1=已到底, 0=还有更多
|
|
160
|
+
}
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Schedule(日程)
|
|
164
|
+
|
|
165
|
+
```typescript
|
|
166
|
+
interface Schedule {
|
|
167
|
+
id?: string;
|
|
168
|
+
name: string;
|
|
169
|
+
start_timestamp: string; // 毫秒级时间戳
|
|
170
|
+
end_timestamp: string;
|
|
171
|
+
jump_channel_id?: string;
|
|
172
|
+
remind_type?: string;
|
|
173
|
+
creator?: {
|
|
174
|
+
user: { id: string; username: string; bot: boolean };
|
|
175
|
+
nick: string;
|
|
176
|
+
joined_at: string;
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## 📋 枚举值定义
|
|
184
|
+
|
|
185
|
+
### 子频道类型(Channel type)
|
|
186
|
+
|
|
187
|
+
| 值 | 名称 | 说明 |
|
|
188
|
+
|----|------|------|
|
|
189
|
+
| `0` | 文字子频道 | 普通文字聊天 |
|
|
190
|
+
| `2` | 语音子频道 | 语音聊天 |
|
|
191
|
+
| `4` | 子频道分组 | 组织子频道的分组(position ≥ 2) |
|
|
192
|
+
| `10005` | 直播子频道 | 直播功能 |
|
|
193
|
+
| `10006` | 应用子频道 | 需 application_id |
|
|
194
|
+
| `10007` | 论坛子频道 | 论坛功能 |
|
|
195
|
+
|
|
196
|
+
### 子频道子类型(Channel sub_type)
|
|
197
|
+
|
|
198
|
+
| 值 | 名称 |
|
|
199
|
+
|----|------|
|
|
200
|
+
| `0` | 闲聊 |
|
|
201
|
+
| `1` | 公告 |
|
|
202
|
+
| `2` | 攻略 |
|
|
203
|
+
| `3` | 开黑 |
|
|
204
|
+
|
|
205
|
+
### 子频道私密类型(Channel private_type)
|
|
206
|
+
|
|
207
|
+
| 值 | 说明 |
|
|
208
|
+
|----|------|
|
|
209
|
+
| `0` | 公开子频道 |
|
|
210
|
+
| `1` | 管理员和指定成员可见 |
|
|
211
|
+
| `2` | 仅管理员可见 |
|
|
212
|
+
|
|
213
|
+
### 子频道发言权限(Channel speak_permission)
|
|
214
|
+
|
|
215
|
+
| 值 | 说明 |
|
|
216
|
+
|----|------|
|
|
217
|
+
| `0` | 无效(仅创建公告子频道时有效,此时为只读) |
|
|
218
|
+
| `1` | 所有人可发言 |
|
|
219
|
+
| `2` | 仅管理员和指定成员可发言 |
|
|
220
|
+
|
|
221
|
+
### 公告类型(announces_type)
|
|
222
|
+
|
|
223
|
+
| 值 | 说明 |
|
|
224
|
+
|----|------|
|
|
225
|
+
| `0` | 成员公告 |
|
|
226
|
+
| `1` | 欢迎公告 |
|
|
227
|
+
|
|
228
|
+
### 帖子格式(format)
|
|
229
|
+
|
|
230
|
+
| 值 | 格式 |
|
|
231
|
+
|----|------|
|
|
232
|
+
| `1` | 纯文本 |
|
|
233
|
+
| `2` | HTML |
|
|
234
|
+
| `3` | Markdown(**默认**) |
|
|
235
|
+
| `4` | JSON(RichText) |
|
|
236
|
+
|
|
237
|
+
### 日程提醒类型(remind_type)
|
|
238
|
+
|
|
239
|
+
| 值 | 说明 |
|
|
240
|
+
|----|------|
|
|
241
|
+
| `"0"` | 不提醒 |
|
|
242
|
+
| `"1"` | 开始时提醒 |
|
|
243
|
+
| `"2"` | 开始前 5 分钟 |
|
|
244
|
+
| `"3"` | 开始前 15 分钟 |
|
|
245
|
+
| `"4"` | 开始前 30 分钟 |
|
|
246
|
+
| `"5"` | 开始前 60 分钟 |
|
|
247
|
+
|
|
248
|
+
### API 权限授权状态(auth_status)
|
|
249
|
+
|
|
250
|
+
| 值 | 说明 |
|
|
251
|
+
|----|------|
|
|
252
|
+
| `0` | 未授权 |
|
|
253
|
+
| `1` | 已授权 |
|
|
254
|
+
|
|
255
|
+
---
|
|
256
|
+
|
|
257
|
+
## 📖 各接口详细说明
|
|
258
|
+
|
|
259
|
+
### GET /users/@me/guilds — 获取频道列表
|
|
260
|
+
|
|
261
|
+
**查询参数**:
|
|
262
|
+
|
|
263
|
+
| 参数 | 类型 | 必填 | 说明 |
|
|
264
|
+
|------|------|------|------|
|
|
265
|
+
| `before` | string | 否 | 读此 guild id 之前的数据 |
|
|
266
|
+
| `after` | string | 否 | 读此 guild id 之后的数据(与 before 同时设置时无效) |
|
|
267
|
+
| `limit` | string | 否 | 每次拉取条数,默认 100,最大 100 |
|
|
268
|
+
|
|
269
|
+
**返回**: `Guild[]`
|
|
270
|
+
|
|
271
|
+
**调用示例**:
|
|
272
|
+
|
|
273
|
+
```json
|
|
274
|
+
{ "method": "GET", "path": "/users/@me/guilds", "query": { "limit": "100" } }
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
---
|
|
278
|
+
|
|
279
|
+
### GET /guilds/{guild_id}/api_permission — 获取频道 API 权限
|
|
280
|
+
|
|
281
|
+
**返回**: `{ apis: APIPermission[] }`
|
|
282
|
+
|
|
283
|
+
**调用示例**:
|
|
284
|
+
|
|
285
|
+
```json
|
|
286
|
+
{ "method": "GET", "path": "/guilds/123456/api_permission" }
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
---
|
|
290
|
+
|
|
291
|
+
### GET /guilds/{guild_id}/channels — 获取子频道列表
|
|
292
|
+
|
|
293
|
+
**返回**: `Channel[]`
|
|
294
|
+
|
|
295
|
+
**调用示例**:
|
|
296
|
+
|
|
297
|
+
```json
|
|
298
|
+
{ "method": "GET", "path": "/guilds/123456/channels" }
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
---
|
|
302
|
+
|
|
303
|
+
### GET /channels/{channel_id} — 获取子频道详情
|
|
304
|
+
|
|
305
|
+
**返回**: `Channel`
|
|
306
|
+
|
|
307
|
+
---
|
|
308
|
+
|
|
309
|
+
### POST /guilds/{guild_id}/channels — 创建子频道
|
|
310
|
+
|
|
311
|
+
> ⚠️ 仅私域机器人可用,需管理频道权限
|
|
312
|
+
|
|
313
|
+
**请求体**:
|
|
314
|
+
|
|
315
|
+
| 参数 | 类型 | 必填 | 说明 |
|
|
316
|
+
|------|------|------|------|
|
|
317
|
+
| `name` | string | 是 | 子频道名称 |
|
|
318
|
+
| `type` | number | 是 | 子频道类型 |
|
|
319
|
+
| `position` | number | 是 | 排序位置(type=4 时 ≥ 2) |
|
|
320
|
+
| `sub_type` | number | 否 | 子类型 |
|
|
321
|
+
| `parent_id` | string | 否 | 所属分组 ID |
|
|
322
|
+
| `private_type` | number | 否 | 私密类型 |
|
|
323
|
+
| `private_user_ids` | string[] | 否 | 私密成员列表(private_type=1 时有效) |
|
|
324
|
+
| `speak_permission` | number | 否 | 发言权限 |
|
|
325
|
+
| `application_id` | string | 否 | 应用 AppID(type=10006 时需要) |
|
|
326
|
+
|
|
327
|
+
**返回**: `Channel`
|
|
328
|
+
|
|
329
|
+
---
|
|
330
|
+
|
|
331
|
+
### PATCH /channels/{channel_id} — 修改子频道
|
|
332
|
+
|
|
333
|
+
> ⚠️ 仅私域机器人可用
|
|
334
|
+
|
|
335
|
+
**请求体**(至少一个):
|
|
336
|
+
|
|
337
|
+
| 参数 | 类型 | 说明 |
|
|
338
|
+
|------|------|------|
|
|
339
|
+
| `name` | string | 名称 |
|
|
340
|
+
| `position` | number | 排序位置 |
|
|
341
|
+
| `parent_id` | string | 分组 ID |
|
|
342
|
+
| `private_type` | number | 私密类型 |
|
|
343
|
+
| `speak_permission` | number | 发言权限 |
|
|
344
|
+
|
|
345
|
+
**返回**: `Channel`
|
|
346
|
+
|
|
347
|
+
---
|
|
348
|
+
|
|
349
|
+
### DELETE /channels/{channel_id} — 删除子频道
|
|
350
|
+
|
|
351
|
+
> ⚠️ 不可逆!仅私域机器人可用
|
|
352
|
+
|
|
353
|
+
---
|
|
354
|
+
|
|
355
|
+
### GET /guilds/{guild_id}/members — 获取成员列表
|
|
356
|
+
|
|
357
|
+
> 仅私域机器人可用
|
|
358
|
+
|
|
359
|
+
**查询参数**:
|
|
360
|
+
|
|
361
|
+
| 参数 | 类型 | 说明 |
|
|
362
|
+
|------|------|------|
|
|
363
|
+
| `after` | string | 上次最后一个 user.id,首次填 `"0"` |
|
|
364
|
+
| `limit` | string | 分页大小 1-400,默认 1 |
|
|
365
|
+
|
|
366
|
+
**返回**: `Member[]`
|
|
367
|
+
|
|
368
|
+
> 翻页:用最后一个 `user.id` 作为 `after`,直到返回空数组。可能返回重复成员,需按 `user.id` 去重。
|
|
369
|
+
|
|
370
|
+
---
|
|
371
|
+
|
|
372
|
+
### GET /guilds/{guild_id}/members/{user_id} — 获取成员详情
|
|
373
|
+
|
|
374
|
+
**返回**: `Member`
|
|
375
|
+
|
|
376
|
+
---
|
|
377
|
+
|
|
378
|
+
### GET /guilds/{guild_id}/roles/{role_id}/members — 获取身份组成员列表
|
|
379
|
+
|
|
380
|
+
> 仅私域机器人可用
|
|
381
|
+
|
|
382
|
+
**查询参数**:
|
|
383
|
+
|
|
384
|
+
| 参数 | 类型 | 说明 |
|
|
385
|
+
|------|------|------|
|
|
386
|
+
| `start_index` | string | 分页标识,首次填 `"0"` |
|
|
387
|
+
| `limit` | string | 分页大小 1-400,默认 1 |
|
|
388
|
+
|
|
389
|
+
**返回**: `{ data: Member[], next: string }`
|
|
390
|
+
|
|
391
|
+
> 翻页:用 `next` 作为 `start_index`,直到 `data` 为空。
|
|
392
|
+
|
|
393
|
+
---
|
|
394
|
+
|
|
395
|
+
### GET /channels/{channel_id}/online_nums — 获取在线成员数
|
|
396
|
+
|
|
397
|
+
**返回**: `{ online_nums: number }`
|
|
398
|
+
|
|
399
|
+
---
|
|
400
|
+
|
|
401
|
+
### POST /guilds/{guild_id}/announces — 创建频道公告
|
|
402
|
+
|
|
403
|
+
**请求体**:
|
|
404
|
+
|
|
405
|
+
| 参数 | 类型 | 必填 | 说明 |
|
|
406
|
+
|------|------|------|------|
|
|
407
|
+
| `message_id` | string | 否 | 消息 ID(有值时创建消息公告,此时 channel_id 必填) |
|
|
408
|
+
| `channel_id` | string | 否 | 子频道 ID |
|
|
409
|
+
| `announces_type` | number | 否 | 0=成员公告,1=欢迎公告 |
|
|
410
|
+
| `recommend_channels` | array | 否 | 推荐子频道列表(最多 3 条,message_id 为空时生效) |
|
|
411
|
+
|
|
412
|
+
> 两种公告类型会互相顶替
|
|
413
|
+
|
|
414
|
+
**返回**: `AnnouncesResult`
|
|
415
|
+
|
|
416
|
+
---
|
|
417
|
+
|
|
418
|
+
### DELETE /guilds/{guild_id}/announces/{message_id} — 删除公告
|
|
419
|
+
|
|
420
|
+
> `message_id` 设为 `all` 删除所有公告
|
|
421
|
+
|
|
422
|
+
---
|
|
423
|
+
|
|
424
|
+
### GET /channels/{channel_id}/threads — 获取帖子列表
|
|
425
|
+
|
|
426
|
+
> 仅私域机器人可用,channel_id 须为论坛子频道(type=10007)
|
|
427
|
+
|
|
428
|
+
**返回**: `ThreadListResult`
|
|
429
|
+
|
|
430
|
+
---
|
|
431
|
+
|
|
432
|
+
### GET /channels/{channel_id}/threads/{thread_id} — 获取帖子详情
|
|
433
|
+
|
|
434
|
+
> 仅私域机器人可用
|
|
435
|
+
|
|
436
|
+
**返回**: `ThreadDetail`
|
|
437
|
+
|
|
438
|
+
---
|
|
439
|
+
|
|
440
|
+
### PUT /channels/{channel_id}/threads — 发表帖子
|
|
441
|
+
|
|
442
|
+
> 仅私域机器人可用
|
|
443
|
+
|
|
444
|
+
**请求体**:
|
|
445
|
+
|
|
446
|
+
| 参数 | 类型 | 必填 | 说明 |
|
|
447
|
+
|------|------|------|------|
|
|
448
|
+
| `title` | string | 是 | 帖子标题 |
|
|
449
|
+
| `content` | string | 是 | 帖子内容 |
|
|
450
|
+
| `format` | number | 否 | 1=文本, 2=HTML, 3=Markdown(默认), 4=JSON |
|
|
451
|
+
|
|
452
|
+
**返回**: `{ task_id: string, create_time: string }`
|
|
453
|
+
|
|
454
|
+
---
|
|
455
|
+
|
|
456
|
+
### DELETE /channels/{channel_id}/threads/{thread_id} — 删除帖子
|
|
457
|
+
|
|
458
|
+
> ⚠️ 不可逆!仅私域机器人可用
|
|
459
|
+
|
|
460
|
+
---
|
|
461
|
+
|
|
462
|
+
### POST /channels/{channel_id}/threads/{thread_id}/comment — 发表评论
|
|
463
|
+
|
|
464
|
+
> 仅私域机器人可用
|
|
465
|
+
|
|
466
|
+
**请求体**:
|
|
467
|
+
|
|
468
|
+
| 参数 | 类型 | 必填 | 说明 |
|
|
469
|
+
|------|------|------|------|
|
|
470
|
+
| `thread_author` | string | 是 | 帖子作者 ID |
|
|
471
|
+
| `content` | string | 是 | 评论内容 |
|
|
472
|
+
| `thread_create_time` | string | 否 | 帖子创建时间 |
|
|
473
|
+
| `image` | string | 否 | 图片链接 |
|
|
474
|
+
|
|
475
|
+
**返回**: `{ task_id: string, create_time: number }`
|
|
476
|
+
|
|
477
|
+
---
|
|
478
|
+
|
|
479
|
+
### POST /channels/{channel_id}/schedules — 创建日程
|
|
480
|
+
|
|
481
|
+
> 需要管理频道权限。单管理员/天限 10 次,单频道/天限 100 次。
|
|
482
|
+
|
|
483
|
+
**请求体**:
|
|
484
|
+
|
|
485
|
+
```json
|
|
486
|
+
{
|
|
487
|
+
"schedule": {
|
|
488
|
+
"name": "日程名称",
|
|
489
|
+
"start_timestamp": "毫秒时间戳",
|
|
490
|
+
"end_timestamp": "毫秒时间戳",
|
|
491
|
+
"jump_channel_id": "0",
|
|
492
|
+
"remind_type": "0"
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
```
|
|
496
|
+
|
|
497
|
+
| 参数 | 类型 | 必填 | 说明 |
|
|
498
|
+
|------|------|------|------|
|
|
499
|
+
| `schedule.name` | string | 是 | 日程名称 |
|
|
500
|
+
| `schedule.start_timestamp` | string | 是 | 开始时间(毫秒) |
|
|
501
|
+
| `schedule.end_timestamp` | string | 是 | 结束时间(毫秒) |
|
|
502
|
+
| `schedule.jump_channel_id` | string | 否 | 跳转子频道 ID,默认 `"0"` |
|
|
503
|
+
| `schedule.remind_type` | string | 否 | 提醒类型,默认 `"0"` |
|
|
504
|
+
|
|
505
|
+
**返回**: `Schedule`
|
|
506
|
+
|
|
507
|
+
---
|
|
508
|
+
|
|
509
|
+
### PATCH /channels/{channel_id}/schedules/{schedule_id} — 修改日程
|
|
510
|
+
|
|
511
|
+
> 需要管理频道权限
|
|
512
|
+
|
|
513
|
+
**请求体**:同创建日程
|
|
514
|
+
|
|
515
|
+
**返回**: `Schedule`
|
|
516
|
+
|
|
517
|
+
---
|
|
518
|
+
|
|
519
|
+
### DELETE /channels/{channel_id}/schedules/{schedule_id} — 删除日程
|
|
520
|
+
|
|
521
|
+
> ⚠️ 不可逆!需要管理频道权限
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: qqbot-media
|
|
3
|
+
description: QQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
|
|
4
|
+
metadata: {"openclaw":{"emoji":"📸","requires":{"config":["channels.qqbot"]}}}
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# QQBot 富媒体收发
|
|
8
|
+
|
|
9
|
+
## 用法
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
<qqmedia>路径或URL</qqmedia>
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
系统根据文件扩展名自动识别类型并路由:
|
|
16
|
+
- `.jpg/.png/.gif/.webp/.bmp` → 图片
|
|
17
|
+
- `.silk/.wav/.mp3/.ogg/.aac/.flac` 等 → 语音
|
|
18
|
+
- `.mp4/.mov/.avi/.mkv/.webm` 等 → 视频
|
|
19
|
+
- 其他扩展名 → 文件
|
|
20
|
+
- 无扩展名的 URL → 默认按图片处理
|
|
21
|
+
|
|
22
|
+
## 接收媒体
|
|
23
|
+
|
|
24
|
+
- 用户发来的**图片**自动下载到本地,路径在上下文【附件】中,可直接用 `<qqmedia>路径</qqmedia>` 回发
|
|
25
|
+
- 用户发来的**语音**路径在上下文中;若有 STT 能力则优先转写
|
|
26
|
+
|
|
27
|
+
## 规则
|
|
28
|
+
|
|
29
|
+
1. **路径必须是绝对路径**(以 `/` 或 `http` 开头)
|
|
30
|
+
2. **标签必须用开闭标签包裹路径**:`<qqmedia>路径</qqmedia>`
|
|
31
|
+
3. **文件大小上限 10MB**
|
|
32
|
+
4. **你有能力发送本地图片/文件**——直接用标签包裹路径即可,**不要说"无法发送"**
|
|
33
|
+
5. 发送语音时不要重复语音中已朗读的文字
|
|
34
|
+
6. 多个媒体用多个标签
|
|
35
|
+
7. 以会话上下文中的能力说明为准(如未启用语音则不要发语音)
|
|
36
|
+
|
|
37
|
+
## 示例
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
这是你要的图片:
|
|
41
|
+
<qqmedia>/Users/xxx/photo.jpg</qqmedia>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
<qqmedia>/tmp/tts/output.mp3</qqmedia>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
视频在这里:
|
|
50
|
+
<qqmedia>https://example.com/video.mp4</qqmedia>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
文件已准备好:
|
|
55
|
+
<qqmedia>/tmp/report.pdf</qqmedia>
|
|
56
|
+
```
|