@alemonjs/qq-bot 2.1.0-alpha.8 → 2.1.0
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.md +13 -45
- package/lib/config.d.ts +8 -0
- package/lib/config.js +20 -0
- package/lib/desktop.d.ts +1 -3
- package/lib/desktop.js +3 -12
- package/lib/hook.d.ts +36 -9
- package/lib/hook.js +21 -19
- package/lib/index.d.ts +5 -7
- package/lib/index.js +11 -21
- package/lib/index.webhook.d.ts +1 -0
- package/lib/index.webhook.js +5 -4
- package/lib/index.websoket.d.ts +1 -0
- package/lib/index.websoket.js +31 -23
- package/lib/message/AT_MESSAGE_CREATE.d.ts +35 -0
- package/lib/message/AT_MESSAGE_CREATE.js +1 -0
- package/lib/message/CHANNEL_CREATE.d.ts +15 -0
- package/lib/message/CHANNEL_CREATE.js +1 -0
- package/lib/message/CHANNEL_DELETE.d.ts +15 -0
- package/lib/message/CHANNEL_DELETE.js +1 -0
- package/lib/message/CHANNEL_UPDATE.d.ts +15 -0
- package/lib/message/CHANNEL_UPDATE.js +1 -0
- package/lib/message/DIRECT_MESSAGE_CREATE.d.ts +29 -0
- package/lib/message/DIRECT_MESSAGE_CREATE.js +1 -0
- package/lib/message/DIRECT_MESSAGE_DELETE.d.ts +17 -0
- package/lib/message/DIRECT_MESSAGE_DELETE.js +1 -0
- package/lib/message/ERROR.d.ts +1 -0
- package/lib/message/ERROR.js +1 -0
- package/lib/message/GUILD_CREATE.d.ts +15 -0
- package/lib/message/GUILD_CREATE.js +1 -0
- package/lib/message/GUILD_DELETE.d.ts +15 -0
- package/lib/message/GUILD_DELETE.js +1 -0
- package/lib/message/GUILD_MEMBER_ADD.d.ts +14 -0
- package/lib/message/GUILD_MEMBER_ADD.js +1 -0
- package/lib/message/GUILD_MEMBER_REMOVE.d.ts +14 -0
- package/lib/message/GUILD_MEMBER_REMOVE.js +1 -0
- package/lib/message/GUILD_MEMBER_UPDATE.d.ts +14 -0
- package/lib/message/GUILD_MEMBER_UPDATE.js +1 -0
- package/lib/message/GUILD_UPDATE.d.ts +15 -0
- package/lib/message/GUILD_UPDATE.js +1 -0
- package/lib/message/INTERACTION_CREATE.d.ts +53 -0
- package/lib/message/INTERACTION_CREATE.js +1 -0
- package/lib/message/MESSAGE_CREATE.d.ts +1 -0
- package/lib/message/MESSAGE_CREATE.js +1 -0
- package/lib/message/MESSAGE_DELETE.d.ts +1 -0
- package/lib/message/MESSAGE_DELETE.js +1 -0
- package/lib/message/MESSAGE_REACTION_ADD.d.ts +13 -0
- package/lib/message/MESSAGE_REACTION_ADD.js +1 -0
- package/lib/message/MESSAGE_REACTION_REMOVE.d.ts +13 -0
- package/lib/message/MESSAGE_REACTION_REMOVE.js +1 -0
- package/lib/message/PUBLIC_MESSAGE_DELETE.d.ts +15 -0
- package/lib/message/PUBLIC_MESSAGE_DELETE.js +1 -0
- package/lib/message/READY.d.ts +6 -0
- package/lib/message/READY.js +1 -0
- package/lib/message/group/C2C_MESSAGE_CREATE.d.ts +9 -0
- package/lib/message/group/C2C_MESSAGE_CREATE.js +1 -0
- package/lib/message/group/C2C_MSG_RECEIVE.d.ts +4 -0
- package/lib/message/group/C2C_MSG_RECEIVE.js +1 -0
- package/lib/message/group/C2C_MSG_REJECT.d.ts +4 -0
- package/lib/message/group/C2C_MSG_REJECT.js +1 -0
- package/lib/message/group/FRIEND_ADD.d.ts +4 -0
- package/lib/message/group/FRIEND_ADD.js +1 -0
- package/lib/message/group/FRIEND_DEL.d.ts +4 -0
- package/lib/message/group/FRIEND_DEL.js +1 -0
- package/lib/message/group/GROUP_ADD_ROBOT.d.ts +5 -0
- package/lib/message/group/GROUP_ADD_ROBOT.js +1 -0
- package/lib/message/group/GROUP_AT_MESSAGE_CREATE.d.ts +11 -0
- package/lib/message/group/GROUP_AT_MESSAGE_CREATE.js +1 -0
- package/lib/message/group/GROUP_DEL_ROBOT.d.ts +5 -0
- package/lib/message/group/GROUP_DEL_ROBOT.js +1 -0
- package/lib/message/group/GROUP_MSG_RECEIVE.d.ts +5 -0
- package/lib/message/group/GROUP_MSG_RECEIVE.js +1 -0
- package/lib/message/group/GROUP_MSG_REJECT.d.ts +5 -0
- package/lib/message/group/GROUP_MSG_REJECT.js +1 -0
- package/lib/register.d.ts +2 -3
- package/lib/register.js +427 -252
- package/lib/sdk/api.d.ts +10 -567
- package/lib/sdk/api.js +234 -796
- package/lib/sdk/client.webhook.d.ts +9 -0
- package/lib/sdk/{client.js → client.webhook.js} +18 -55
- package/lib/sdk/client.websoket.d.ts +9 -0
- package/lib/sdk/client.websoket.js +52 -97
- package/lib/sdk/config.d.ts +1 -0
- package/lib/sdk/instance.d.ts +3 -0
- package/lib/sdk/instance.js +93 -0
- package/lib/sdk/intents.d.ts +3 -0
- package/lib/sdk/intents.js +25 -90
- package/lib/sdk/message.d.ts +4 -0
- package/lib/sdk/message.group.d.ts +24 -0
- package/lib/sdk/message.group.js +1 -0
- package/lib/sdk/message.guild.d.ts +38 -0
- package/lib/sdk/message.guild.js +1 -0
- package/lib/sdk/message.js +1 -0
- package/lib/sdk/message.public.d.ts +6 -0
- package/lib/sdk/message.public.js +1 -0
- package/lib/sdk/typing.d.ts +22 -11
- package/lib/sdk/typing.js +1 -0
- package/lib/sdk/webhook.secret.d.ts +14 -0
- package/lib/sdk/webhook.secret.js +6 -21
- package/lib/sends.d.ts +29 -0
- package/lib/sends.js +326 -745
- package/lib/utils.d.ts +1 -0
- package/lib/utils.js +7 -12
- package/package.json +9 -5
- package/lib/index.group.js +0 -19
- package/lib/index.guild.js +0 -36
- package/lib/sdk/client.websoket.group.js +0 -221
- package/lib/sdk/client.websoket.guild.js +0 -205
- package/lib/sdk/counter.js +0 -19
- package/lib/sdk/from.js +0 -44
package/lib/sdk/api.d.ts
CHANGED
|
@@ -1,69 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { AxiosRequestConfig } from 'axios';
|
|
1
|
+
import { type AxiosRequestConfig } from 'axios';
|
|
3
2
|
import { ApiRequestData, FileType } from './typing.js';
|
|
4
|
-
|
|
5
|
-
declare
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
*/
|
|
12
|
-
getAuthentication(app_id: string, clientSecret: string): Promise<axios.AxiosResponse<any, any>>;
|
|
13
|
-
/**
|
|
14
|
-
* group
|
|
15
|
-
* @param config
|
|
16
|
-
* @returns
|
|
17
|
-
*/
|
|
18
|
-
groupService(options: AxiosRequestConfig): Promise<axios.AxiosResponse<any, any>>;
|
|
19
|
-
/**
|
|
20
|
-
* guild
|
|
21
|
-
* @param opstion
|
|
22
|
-
* @returns
|
|
23
|
-
*/
|
|
24
|
-
guildServer(opstion: AxiosRequestConfig): Promise<axios.AxiosResponse<any, any>>;
|
|
25
|
-
/**
|
|
26
|
-
* 得到鉴权
|
|
27
|
-
* @returns
|
|
28
|
-
*/
|
|
3
|
+
export declare const BOTS_API_RUL = "https://bots.qq.com";
|
|
4
|
+
export declare const API_URL_SANDBOX = "https://sandbox.api.sgroup.qq.com";
|
|
5
|
+
export declare const API_URL = "https://api.sgroup.qq.com";
|
|
6
|
+
export declare class QQBotAPI {
|
|
7
|
+
getAuthentication(): Promise<any>;
|
|
8
|
+
groupService(options: AxiosRequestConfig): Promise<any>;
|
|
9
|
+
guildServer(options: AxiosRequestConfig): Promise<any>;
|
|
29
10
|
gateway(): Promise<any>;
|
|
30
|
-
/**
|
|
31
|
-
* 发送私聊消息
|
|
32
|
-
* @param openid
|
|
33
|
-
* @param content
|
|
34
|
-
* @param msg_id
|
|
35
|
-
* @returns
|
|
36
|
-
* 0 文本 1 图文 2 md 3 ark 4 embed
|
|
37
|
-
*/
|
|
38
11
|
usersOpenMessages(openid: string, data: ApiRequestData): Promise<{
|
|
39
12
|
id: string;
|
|
40
13
|
timestamp: number;
|
|
41
14
|
}>;
|
|
42
|
-
/**
|
|
43
|
-
* 得到消息序列
|
|
44
|
-
* @param MessageId
|
|
45
|
-
* @returns
|
|
46
|
-
*/
|
|
47
15
|
getMessageSeq(MessageId: string): number;
|
|
48
|
-
/**
|
|
49
|
-
* 发送群聊消息
|
|
50
|
-
* @param group_openid
|
|
51
|
-
* @param data
|
|
52
|
-
* @returns
|
|
53
|
-
*/
|
|
54
16
|
groupOpenMessages(group_openid: string, data: ApiRequestData): Promise<{
|
|
55
17
|
id: string;
|
|
56
18
|
timestamp: number;
|
|
57
19
|
}>;
|
|
58
|
-
|
|
59
|
-
* 发送私聊富媒体文件
|
|
60
|
-
* @param openid
|
|
61
|
-
* @param data
|
|
62
|
-
* @returns
|
|
63
|
-
* 1 图文 2 视频 3 语言 4 文件
|
|
64
|
-
* 图片:png/jpg,视频:mp4,语音:silk
|
|
65
|
-
*/
|
|
66
|
-
postRichMediaByUsers(openid: string, data: {
|
|
20
|
+
postRichMediaByUser(openid: string, data: {
|
|
67
21
|
srv_send_msg?: boolean;
|
|
68
22
|
file_type: FileType;
|
|
69
23
|
url?: string;
|
|
@@ -73,32 +27,6 @@ declare class QQBotAPI {
|
|
|
73
27
|
file_info: string;
|
|
74
28
|
ttl: number;
|
|
75
29
|
}>;
|
|
76
|
-
/**
|
|
77
|
-
* 发送私聊富媒体文件
|
|
78
|
-
* @param openid
|
|
79
|
-
* @param data
|
|
80
|
-
* @returns
|
|
81
|
-
* 1 图文 2 视频 3 语言 4 文件
|
|
82
|
-
* 图片:png/jpg,视频:mp4,语音:silk
|
|
83
|
-
*/
|
|
84
|
-
userFiles(openid: string, data: {
|
|
85
|
-
srv_send_msg: boolean;
|
|
86
|
-
file_type: FileType;
|
|
87
|
-
url: string;
|
|
88
|
-
file_data?: any;
|
|
89
|
-
}): Promise<{
|
|
90
|
-
file_uuid: string;
|
|
91
|
-
file_info: string;
|
|
92
|
-
ttl: number;
|
|
93
|
-
}>;
|
|
94
|
-
/**
|
|
95
|
-
* 发送群里文件
|
|
96
|
-
* @param openid
|
|
97
|
-
* @param data
|
|
98
|
-
* @returns
|
|
99
|
-
* 1 图文 2 视频 3 语言 4 文件
|
|
100
|
-
* 图片:png/jpg,视频:mp4,语音:silk
|
|
101
|
-
*/
|
|
102
30
|
postRichMediaByGroup(openid: string, data: {
|
|
103
31
|
srv_send_msg?: boolean;
|
|
104
32
|
file_type: FileType;
|
|
@@ -109,48 +37,8 @@ declare class QQBotAPI {
|
|
|
109
37
|
file_info: string;
|
|
110
38
|
ttl: number;
|
|
111
39
|
}>;
|
|
112
|
-
/**
|
|
113
|
-
*
|
|
114
|
-
* @param openid
|
|
115
|
-
* @param data
|
|
116
|
-
* @returns
|
|
117
|
-
*/
|
|
118
|
-
groupsFiles(openid: string, data: {
|
|
119
|
-
srv_send_msg?: boolean;
|
|
120
|
-
file_type: FileType;
|
|
121
|
-
url?: string;
|
|
122
|
-
file_data?: any;
|
|
123
|
-
}): Promise<{
|
|
124
|
-
file_uuid: string;
|
|
125
|
-
file_info: string;
|
|
126
|
-
ttl: number;
|
|
127
|
-
}>;
|
|
128
|
-
/**
|
|
129
|
-
*
|
|
130
|
-
* @param openid
|
|
131
|
-
* @param message_id
|
|
132
|
-
* @returns
|
|
133
|
-
*/
|
|
134
40
|
userMessageDelete(openid: string, message_id: string): Promise<any>;
|
|
135
|
-
/**
|
|
136
|
-
*
|
|
137
|
-
* @param group_openid
|
|
138
|
-
* @param message_id
|
|
139
|
-
* @returns
|
|
140
|
-
*/
|
|
141
41
|
grouMessageDelte(group_openid: string, message_id: string): Promise<any>;
|
|
142
|
-
/**
|
|
143
|
-
* ************
|
|
144
|
-
* 消息-图片接口
|
|
145
|
-
* ***********
|
|
146
|
-
*/
|
|
147
|
-
/**
|
|
148
|
-
*
|
|
149
|
-
* @param channel_id
|
|
150
|
-
* @param message
|
|
151
|
-
* @param image
|
|
152
|
-
* @returns
|
|
153
|
-
*/
|
|
154
42
|
channelsMessages(channel_id: string, message: {
|
|
155
43
|
content?: string;
|
|
156
44
|
embed?: any;
|
|
@@ -161,12 +49,6 @@ declare class QQBotAPI {
|
|
|
161
49
|
event_id?: string;
|
|
162
50
|
markdown?: any;
|
|
163
51
|
}, image?: Buffer): Promise<any>;
|
|
164
|
-
/**
|
|
165
|
-
* 私聊发送
|
|
166
|
-
* @param id 私信传频道id,公信传子频道id
|
|
167
|
-
* @param message {消息编号,图片,内容}
|
|
168
|
-
* @returns
|
|
169
|
-
*/
|
|
170
52
|
dmsMessages(guild_id: string, message: {
|
|
171
53
|
content?: string;
|
|
172
54
|
embed?: any;
|
|
@@ -177,60 +59,15 @@ declare class QQBotAPI {
|
|
|
177
59
|
event_id?: string;
|
|
178
60
|
markdown?: any;
|
|
179
61
|
}, image?: Buffer): Promise<any>;
|
|
180
|
-
/**
|
|
181
|
-
* ********
|
|
182
|
-
* 用户api
|
|
183
|
-
* *******
|
|
184
|
-
*/
|
|
185
|
-
/**
|
|
186
|
-
* 获取用户详情
|
|
187
|
-
* @param message
|
|
188
|
-
* @returns
|
|
189
|
-
*/
|
|
190
62
|
usersMe(): Promise<any>;
|
|
191
|
-
/**
|
|
192
|
-
* 获取用户频道列表
|
|
193
|
-
* @param message
|
|
194
|
-
* @returns
|
|
195
|
-
*/
|
|
196
63
|
usersMeGuilds(params: {
|
|
197
64
|
before: string;
|
|
198
65
|
after: string;
|
|
199
66
|
limit: number;
|
|
200
67
|
}): Promise<any>;
|
|
201
|
-
/**
|
|
202
|
-
* **********
|
|
203
|
-
* 频道api
|
|
204
|
-
* **********
|
|
205
|
-
*/
|
|
206
|
-
/**
|
|
207
|
-
* 获取频道详细
|
|
208
|
-
* @param guild_id
|
|
209
|
-
* @returns
|
|
210
|
-
*/
|
|
211
68
|
guilds(guild_id: string): Promise<any>;
|
|
212
|
-
/**
|
|
213
|
-
* ************
|
|
214
|
-
* 子频道api
|
|
215
|
-
* ***********
|
|
216
|
-
*/
|
|
217
|
-
/**
|
|
218
|
-
* 获取子频道列表
|
|
219
|
-
* @param guild_id
|
|
220
|
-
* @returns
|
|
221
|
-
*/
|
|
222
69
|
guildsChannels(guild_id: string): Promise<any>;
|
|
223
|
-
/**
|
|
224
|
-
* 获取子频道详情
|
|
225
|
-
* @param channel_id
|
|
226
|
-
* @returns
|
|
227
|
-
*/
|
|
228
70
|
channels(channel_id: string): Promise<any>;
|
|
229
|
-
/**
|
|
230
|
-
* 创建子频道
|
|
231
|
-
* @param guild_id
|
|
232
|
-
* @returns
|
|
233
|
-
*/
|
|
234
71
|
guildsChannelsCreate(guild_id: string, data: {
|
|
235
72
|
name: string;
|
|
236
73
|
type: number;
|
|
@@ -242,11 +79,6 @@ declare class QQBotAPI {
|
|
|
242
79
|
speak_permission: number;
|
|
243
80
|
application_id: string;
|
|
244
81
|
}): Promise<any>;
|
|
245
|
-
/**
|
|
246
|
-
* 创建子频道
|
|
247
|
-
* @param channel_id
|
|
248
|
-
* @returns
|
|
249
|
-
*/
|
|
250
82
|
guildsChannelsUpdate(channel_id: string, data: {
|
|
251
83
|
name: string;
|
|
252
84
|
position: number;
|
|
@@ -254,12 +86,6 @@ declare class QQBotAPI {
|
|
|
254
86
|
private_type: number;
|
|
255
87
|
speak_permission: number;
|
|
256
88
|
}): Promise<any>;
|
|
257
|
-
/**
|
|
258
|
-
* 删除子频道
|
|
259
|
-
* @param channel_id
|
|
260
|
-
* @param data
|
|
261
|
-
* @returns
|
|
262
|
-
*/
|
|
263
89
|
guildsChannelsdelete(channel_id: string, data: {
|
|
264
90
|
name: string;
|
|
265
91
|
position: number;
|
|
@@ -267,312 +93,63 @@ declare class QQBotAPI {
|
|
|
267
93
|
private_type: number;
|
|
268
94
|
speak_permission: number;
|
|
269
95
|
}): Promise<any>;
|
|
270
|
-
/**
|
|
271
|
-
* 获取在线成员数
|
|
272
|
-
* @param channel_id
|
|
273
|
-
* @returns
|
|
274
|
-
*/
|
|
275
96
|
channelsChannelOnlineNums(channel_id: string): Promise<any>;
|
|
276
|
-
/**
|
|
277
|
-
* *********
|
|
278
|
-
* 成员api
|
|
279
|
-
* *********
|
|
280
|
-
*/
|
|
281
|
-
/**
|
|
282
|
-
* 获取频道成员列表
|
|
283
|
-
* @param guild_id
|
|
284
|
-
* @returns
|
|
285
|
-
*/
|
|
286
97
|
guildsMembers(guild_id: string, params: {
|
|
287
98
|
after: string;
|
|
288
99
|
limit: number;
|
|
289
100
|
}): Promise<any>;
|
|
290
|
-
/**
|
|
291
|
-
* 获取频道身份组成员列表
|
|
292
|
-
* @param guild_id
|
|
293
|
-
* @param role_id
|
|
294
|
-
* @param params
|
|
295
|
-
* @returns
|
|
296
|
-
*/
|
|
297
101
|
guildsRolesMembers(guild_id: string, role_id: string, params: {
|
|
298
102
|
start_index: string;
|
|
299
103
|
limit: number;
|
|
300
104
|
}): Promise<any>;
|
|
301
|
-
/**
|
|
302
|
-
* 获取成员详情
|
|
303
|
-
* @param guild_id
|
|
304
|
-
* @param user_id
|
|
305
|
-
* @returns
|
|
306
|
-
*/
|
|
307
105
|
guildsMembersMessage(guild_id: string, user_id: string): Promise<any>;
|
|
308
|
-
/**
|
|
309
|
-
* 删除频道成员
|
|
310
|
-
* @param guild_id
|
|
311
|
-
* @param user_id
|
|
312
|
-
* @returns
|
|
313
|
-
*/
|
|
314
106
|
guildsMembersDelete(guild_id: string, user_id: string): Promise<any>;
|
|
315
|
-
/**
|
|
316
|
-
* 获取指定消息
|
|
317
|
-
* @param channel_id
|
|
318
|
-
* @param message_id
|
|
319
|
-
* @returns
|
|
320
|
-
*/
|
|
321
107
|
channelsMessagesById(channel_id: string, message_id: string): Promise<any>;
|
|
322
|
-
/**
|
|
323
|
-
* 撤回消息
|
|
324
|
-
* @param channel_id
|
|
325
|
-
* @param message_id
|
|
326
|
-
* @param hidetip
|
|
327
|
-
* @returns
|
|
328
|
-
*/
|
|
329
108
|
channelsMessagesDelete(channel_id: string, message_id: string, hidetip?: boolean): Promise<any>;
|
|
330
|
-
/**
|
|
331
|
-
* ***********
|
|
332
|
-
* 频道身份api
|
|
333
|
-
* ***********
|
|
334
|
-
*/
|
|
335
|
-
/**
|
|
336
|
-
* 获取频道身份组列表
|
|
337
|
-
* @param guild_id 频道id
|
|
338
|
-
* @returns
|
|
339
|
-
*/
|
|
340
109
|
guildsRoles(guild_id: string): Promise<any>;
|
|
341
|
-
/**
|
|
342
|
-
* 创建频道身份组
|
|
343
|
-
* @param guild_id 频道id
|
|
344
|
-
* @param {object} data 参数
|
|
345
|
-
* @param {object?} data.name 身份组名称
|
|
346
|
-
* @param {object?} data.color ARGB 的 HEX 十六进制颜色值转换后的十进制数值
|
|
347
|
-
* @param {object?} data.hoist 在成员列表中单独展示: 0-否, 1-是
|
|
348
|
-
* @returns
|
|
349
|
-
*/
|
|
350
110
|
guildsRolesPost(guild_id: string, data: {
|
|
351
111
|
name?: string;
|
|
352
112
|
color?: number;
|
|
353
113
|
hoist?: 0 | 1;
|
|
354
114
|
}): Promise<any>;
|
|
355
|
-
/**
|
|
356
|
-
* 修改频道身份组
|
|
357
|
-
* @param guild_id 频道id
|
|
358
|
-
* @param {object} data 参数
|
|
359
|
-
* @param {object?} data.name 身份组名称
|
|
360
|
-
* @param {object?} data.color ARGB 的 HEX 十六进制颜色值转换后的十进制数值
|
|
361
|
-
* @param {object?} data.hoist 在成员列表中单独展示: 0-否, 1-是
|
|
362
|
-
* @returns
|
|
363
|
-
*/
|
|
364
115
|
guildsRolesPatch(guild_id: string, role_id: string, data: {
|
|
365
116
|
name?: string;
|
|
366
117
|
color?: number;
|
|
367
118
|
hoist?: 0 | 1;
|
|
368
119
|
}): Promise<any>;
|
|
369
|
-
/**
|
|
370
|
-
* 删除频道身份组
|
|
371
|
-
* @param guild_id 频道id
|
|
372
|
-
* @param role_id 身份组id
|
|
373
|
-
*/
|
|
374
120
|
guildsRolesDelete(guild_id: string, role_id: string): Promise<any>;
|
|
375
|
-
/**
|
|
376
|
-
* 将成员添加到频道身份组
|
|
377
|
-
* @param guild_id 频道id
|
|
378
|
-
* @param channel_id 子频道id
|
|
379
|
-
* @param user_id 用户id
|
|
380
|
-
* @param role_id 身份组id
|
|
381
|
-
* @returns
|
|
382
|
-
*/
|
|
383
121
|
guildsRolesMembersPut(guild_id: string, channel_id: string, user_id: string, role_id: string): Promise<any>;
|
|
384
|
-
/**
|
|
385
|
-
* 将成员从频道身份组移除
|
|
386
|
-
* @param guild_id 频道id
|
|
387
|
-
* @param channel_id 子频道id
|
|
388
|
-
* @param user_id 用户id
|
|
389
|
-
* @param role_id 身份组id
|
|
390
|
-
* @returns
|
|
391
|
-
*/
|
|
392
122
|
guildsRolesMembersDelete(guild_id: string, channel_id: string, user_id: string, role_id: string): Promise<any>;
|
|
393
|
-
/**
|
|
394
|
-
* **********
|
|
395
|
-
* 子频道权限api
|
|
396
|
-
* **********
|
|
397
|
-
*/
|
|
398
|
-
/**
|
|
399
|
-
* 获取子频道用户权限
|
|
400
|
-
* @param channel_id 子频道id
|
|
401
|
-
* @param user_id 用户id
|
|
402
|
-
*/
|
|
403
123
|
channelsPermissions(channel_id: string, user_id: string): Promise<any>;
|
|
404
|
-
/**
|
|
405
|
-
* 修改子频道用户权限
|
|
406
|
-
* @param channel_id 子频道id
|
|
407
|
-
* @param user_id 用户id
|
|
408
|
-
* @param 参数包括add和remove两个字段分别表示授予的权限以及删除的权限。要授予用户权限即把add对应位置 1,删除用户权限即把remove对应位置 1。当两个字段同一位都为 1,表现为删除权限。
|
|
409
|
-
*/
|
|
410
124
|
channelsPermissionsPut(channel_id: string, user_id: string, add: string, remove: string): Promise<any>;
|
|
411
|
-
/**
|
|
412
|
-
* *******
|
|
413
|
-
* 消息api
|
|
414
|
-
* ********
|
|
415
|
-
*/
|
|
416
|
-
/**
|
|
417
|
-
* ************
|
|
418
|
-
* 消息频率api
|
|
419
|
-
* **********
|
|
420
|
-
*/
|
|
421
|
-
/**
|
|
422
|
-
* 查询频道消息频率限制
|
|
423
|
-
* @param guild_id 频道id
|
|
424
|
-
* @returns
|
|
425
|
-
*/
|
|
426
125
|
guildsMessageSetting(guild_id: string): Promise<any>;
|
|
427
|
-
/**
|
|
428
|
-
* ***********
|
|
429
|
-
* 私信api
|
|
430
|
-
* **********
|
|
431
|
-
*/
|
|
432
|
-
/**
|
|
433
|
-
* 创建私信会话
|
|
434
|
-
* @param recipient_id 接收者 id
|
|
435
|
-
* @param source_guild_id 源频道 id
|
|
436
|
-
* @returns
|
|
437
|
-
*/
|
|
438
126
|
usersMeDms(): Promise<any>;
|
|
439
|
-
/**
|
|
440
|
-
* 撤回私信
|
|
441
|
-
* @param guild_id
|
|
442
|
-
* @param data
|
|
443
|
-
* @returns
|
|
444
|
-
*/
|
|
445
127
|
dmsMessageDelete(guild_id: string, message_id: string, hidetip?: boolean): Promise<any>;
|
|
446
|
-
/**
|
|
447
|
-
* *********
|
|
448
|
-
* 禁言api
|
|
449
|
-
* *******
|
|
450
|
-
*/
|
|
451
|
-
/**
|
|
452
|
-
* 全体禁言(非管理员)
|
|
453
|
-
* @param guild_id 频道id
|
|
454
|
-
* @param data { mute_end_timestamp:禁言结束时间戳, mute_seconds:禁言时长 } 两个参数必须传一个 优先级 mute_end_timestamp > mute_seconds
|
|
455
|
-
* 将mute_end_timestamp或mute_seconds传值为字符串'0',则表示解除全体禁言
|
|
456
|
-
*/
|
|
457
128
|
guildsMuteAll(guild_id: string, data: {
|
|
458
129
|
mute_end_timestamp?: string;
|
|
459
130
|
mute_seconds?: string;
|
|
460
131
|
}): Promise<any>;
|
|
461
|
-
/**
|
|
462
|
-
* 频道指定成员禁言
|
|
463
|
-
* @param guild_id 频道id
|
|
464
|
-
* @param user_id 用户id
|
|
465
|
-
* @param data { mute_end_timestamp:禁言结束时间戳, mute_seconds:禁言时长 } 两个参数必须传一个 优先级 mute_end_timestamp > mute_seconds
|
|
466
|
-
* 将mute_end_timestamp或mute_seconds传值为字符串'0',则表示解除禁言
|
|
467
|
-
* @returns
|
|
468
|
-
*/
|
|
469
132
|
guildsMemberMute(guild_id: string, user_id: string, data: {
|
|
470
133
|
mute_end_timestamp?: string;
|
|
471
134
|
mute_seconds?: string;
|
|
472
135
|
}): Promise<any>;
|
|
473
|
-
/**
|
|
474
|
-
* 频道批量禁言
|
|
475
|
-
* @param guild_id 频道id
|
|
476
|
-
* @param data { mute_end_timestamp:禁言结束时间戳, mute_seconds:禁言时长, user_ids:用户id数组 } 两个参数必须传一个 优先级 mute_end_timestamp > mute_seconds
|
|
477
|
-
* 将mute_end_timestamp或mute_seconds传值为字符串'0',则表示解除禁言
|
|
478
|
-
*/
|
|
479
136
|
guildsMute(guild_id: string, data: {
|
|
480
137
|
mute_end_timestamp?: string;
|
|
481
138
|
mute_seconds?: string;
|
|
482
139
|
user_ids: string[];
|
|
483
140
|
}): Promise<any>;
|
|
484
|
-
/**
|
|
485
|
-
* *******
|
|
486
|
-
* 公告api
|
|
487
|
-
* *******
|
|
488
|
-
*/
|
|
489
|
-
/**
|
|
490
|
-
* 创建频道公告
|
|
491
|
-
* 公告类型分为 消息类型的频道公告 和 推荐子频道类型的频道公告
|
|
492
|
-
* 详见 https://bot.q.qq.com/wiki/develop/api-v2/server-inter/channel/content/announces/post_guild_announces.html#%E5%8A%9F%E8%83%BD%E6%8F%8F%E8%BF%B0
|
|
493
|
-
* @param guild_id 频道id
|
|
494
|
-
* @param data { message_id:消息id, channel_id:频道id, announces_type:公告类型, recommend_channels:推荐频道id数组 }
|
|
495
|
-
* @param channel_id 子频道id 消息id存在时必须传
|
|
496
|
-
* @param announces_type 0:成员公告 1:欢迎公告 默认为 0
|
|
497
|
-
* @param recommend_channels 推荐频道id数组 "recommend_channels": [{ "channel_id": "xxxx","introduce": "推荐语" }]
|
|
498
|
-
* @returns 返回Announces 对象 (https://bot.q.qq.com/wiki/develop/api-v2/server-inter/channel/content/announces/model.html#Announces)
|
|
499
|
-
*/
|
|
500
141
|
guildsAnnounces(guild_id: string, data: {
|
|
501
142
|
message_id?: string;
|
|
502
143
|
channel_id?: string;
|
|
503
144
|
announces_type?: 0 | 1;
|
|
504
145
|
recommend_channels?: string[];
|
|
505
146
|
}): Promise<any>;
|
|
506
|
-
/**
|
|
507
|
-
* 删除频道公告
|
|
508
|
-
* @param guild_id 频道id
|
|
509
|
-
* @param message_id 消息id message_id 有值时,会校验 message_id 合法性,若不校验校验 message_id,请将 message_id 设置为 all
|
|
510
|
-
* @returns
|
|
511
|
-
*/
|
|
512
147
|
guildsAnnouncesDelete(guild_id: string, message_id: string): Promise<any>;
|
|
513
|
-
/**
|
|
514
|
-
* **********
|
|
515
|
-
* 精华消息api
|
|
516
|
-
* **********
|
|
517
|
-
*/
|
|
518
|
-
/**
|
|
519
|
-
* 添加精华消息
|
|
520
|
-
* @param channel_id 频道id
|
|
521
|
-
* @param message_id 消息id
|
|
522
|
-
* @returns 返回 PinsMessage对象 { "guild_id": "xxxxxx", "channel_id": "xxxxxx", "message_ids": ["xxxxx"]}
|
|
523
|
-
* @returns message_ids 为当前请求后子频道内所有精华消息 message_id 数组
|
|
524
|
-
*/
|
|
525
148
|
channelsPinsPut(channel_id: string, message_id: string): Promise<any>;
|
|
526
|
-
/**
|
|
527
|
-
* 删除精华消息
|
|
528
|
-
* @param channel_id 子频道id
|
|
529
|
-
* @param message_id 消息id
|
|
530
|
-
* 删除子频道内全部精华消息,请将 message_id 设置为 all
|
|
531
|
-
* @returns
|
|
532
|
-
*/
|
|
533
149
|
channelsPinsDelete(channel_id: string, message_id: string): Promise<any>;
|
|
534
|
-
/**
|
|
535
|
-
* 获取精华消息
|
|
536
|
-
* @param channel_id 子频道id
|
|
537
|
-
* @returns 返回 PinsMessage对象 { "guild_id": "xxxxxx", "channel_id": "xxxxxx", "message_ids": ["xxxxx"]}
|
|
538
|
-
* @returns message_ids 为当前请求后子频道内所有精华消息 message_id 数组
|
|
539
|
-
*/
|
|
540
150
|
channelsPins(channel_id: string): Promise<any>;
|
|
541
|
-
/**
|
|
542
|
-
* ********
|
|
543
|
-
* 日程api
|
|
544
|
-
* *******
|
|
545
|
-
*/
|
|
546
|
-
/**
|
|
547
|
-
* 获取频道日程列表
|
|
548
|
-
* @param channel_id 子频道id
|
|
549
|
-
* @returns 返回 Schedule 对象数组(详见https://bot.q.qq.com/wiki/develop/api-v2/server-inter/channel/content/schedule/model.html#schedule)
|
|
550
|
-
*/
|
|
551
151
|
channelsSchedules(channel_id: string): Promise<any>;
|
|
552
|
-
/**
|
|
553
|
-
* 获取频道日程详情
|
|
554
|
-
* @param channel_id 子频道id
|
|
555
|
-
* @param schedule_id 日程id
|
|
556
|
-
* @returns 返回 Schedule 对象(详见https://bot.q.qq.com/wiki/develop/api-v2/server-inter/channel/content/schedule/model.html#schedule)
|
|
557
|
-
*/
|
|
558
152
|
channelsSchedulesSchedule(channel_id: string, schedule_id: string): Promise<any>;
|
|
559
|
-
/**
|
|
560
|
-
* 创建频道日程
|
|
561
|
-
* @param channel_id 子频道id
|
|
562
|
-
* @param name 日程名称
|
|
563
|
-
* @param description 日程描述
|
|
564
|
-
* @param start_timestamp 日程开始时间戳
|
|
565
|
-
* @param end_timestamp 日程结束时间戳
|
|
566
|
-
* @param jump_channel_id 日程开始时跳转的子频道id
|
|
567
|
-
* @param remind_type 日程提醒类型
|
|
568
|
-
* 0 不提醒
|
|
569
|
-
* 1 开始时提醒
|
|
570
|
-
* 2 开始前 5 分钟提醒
|
|
571
|
-
* 3 开始前 15 分钟提醒
|
|
572
|
-
* 4 开始前 30 分钟提醒
|
|
573
|
-
* 5 开始前 60 分钟提醒
|
|
574
|
-
* @returns 返回 Schedule 对象(详见https://bot.q.qq.com/wiki/develop/api-v2/server-inter/channel/content/schedule/model.html#schedule)
|
|
575
|
-
*/
|
|
576
153
|
channelsSchedulesPost(channel_id: string, data: {
|
|
577
154
|
schedule: {
|
|
578
155
|
name: string;
|
|
@@ -583,24 +160,6 @@ declare class QQBotAPI {
|
|
|
583
160
|
remind_type: number;
|
|
584
161
|
};
|
|
585
162
|
}): Promise<any>;
|
|
586
|
-
/**
|
|
587
|
-
* 修改频道日程
|
|
588
|
-
* @param channel_id 子频道id
|
|
589
|
-
* @param schedule_id 日程id
|
|
590
|
-
* @param name 日程名称
|
|
591
|
-
* @param description 日程描述
|
|
592
|
-
* @param start_timestamp 日程开始时间戳
|
|
593
|
-
* @param end_timestamp 日程结束时间戳
|
|
594
|
-
* @param jump_channel_id 日程开始时跳转的子频道id
|
|
595
|
-
* @param remind_type 日程提醒类型
|
|
596
|
-
* 0 不提醒
|
|
597
|
-
* 1 开始时提醒
|
|
598
|
-
* 2 开始前 5 分钟提醒
|
|
599
|
-
* 3 开始前 15 分钟提醒
|
|
600
|
-
* 4 开始前 30 分钟提醒
|
|
601
|
-
* 5 开始前 60 分钟提醒
|
|
602
|
-
* @returns 返回 Schedule 对象(详见https://bot.q.qq.com/wiki/develop/api-v2/server-inter/channel/content/schedule/model.html#schedule)
|
|
603
|
-
*/
|
|
604
163
|
channelsSchedulesSchedulePatch(channel_id: string, schedule_id: string, data: {
|
|
605
164
|
schedule: {
|
|
606
165
|
name: string;
|
|
@@ -611,144 +170,28 @@ declare class QQBotAPI {
|
|
|
611
170
|
remind_type: number;
|
|
612
171
|
};
|
|
613
172
|
}): Promise<any>;
|
|
614
|
-
/**
|
|
615
|
-
* 删除频道日程
|
|
616
|
-
* @param channel_id 子频道id
|
|
617
|
-
* @param schedule_id 日程id
|
|
618
|
-
* @returns
|
|
619
|
-
*/
|
|
620
173
|
channelsSchedulesScheduleDelete(channel_id: string, schedule_id: string): Promise<any>;
|
|
621
|
-
/**
|
|
622
|
-
* ***********
|
|
623
|
-
* 表情表态api
|
|
624
|
-
* ***********
|
|
625
|
-
*/
|
|
626
|
-
/**
|
|
627
|
-
* 机器人发表表情表态
|
|
628
|
-
* @param channel_id 子频道id
|
|
629
|
-
* @param message_id 消息id
|
|
630
|
-
* @param type 表情类型 1:系统表情 2:emoji表情
|
|
631
|
-
* @param id 表情id 参考https://bot.q.qq.com/wiki/develop/api-v2/openapi/emoji/model.html#Emoji%20%E5%88%97%E8%A1%A8
|
|
632
|
-
* @returns
|
|
633
|
-
*/
|
|
634
174
|
channelsMessagesReactionsPut(channel_id: string, message_id: string, type: 1 | 2, id: string): Promise<any>;
|
|
635
|
-
/**
|
|
636
|
-
* 删除机器人发表的表情表态
|
|
637
|
-
* @param channel_id 子频道id
|
|
638
|
-
* @param message_id 消息id
|
|
639
|
-
* @param type 表情类型 1:系统表情 2:emoji表情
|
|
640
|
-
* @param id 表情id 参考https://bot.q.qq.com/wiki/develop/api-v2/openapi/emoji/model.html#Emoji%20%E5%88%97%E8%A1%A8
|
|
641
|
-
* @returns
|
|
642
|
-
*/
|
|
643
175
|
channelsMessagesReactionsDelete(channel_id: string, message_id: string, type: 1 | 2, id: string): Promise<any>;
|
|
644
|
-
/**
|
|
645
|
-
* 获取消息表情表态的用户列表
|
|
646
|
-
* @param channel_id 子频道id
|
|
647
|
-
* @param message_id 消息id
|
|
648
|
-
* @param type 表情类型 1:系统表情 2:emoji表情
|
|
649
|
-
* @param id 表情id 参考https://bot.q.qq.com/wiki/develop/api-v2/openapi/emoji/model.html#Emoji%20%E5%88%97%E8%A1%A8
|
|
650
|
-
* @param {object} data
|
|
651
|
-
* @param {object} data.cookie 返回的cookie 第一次请求不传,后续请求传上次返回的cookie
|
|
652
|
-
* @param {object} data.limit 返回的用户数量 默认20 最大50
|
|
653
|
-
* @returns data:{ users:User[], cookie:string,is_end:true|false }
|
|
654
|
-
*/
|
|
655
176
|
channelsMessagesReactionsUsers(channel_id: string, message_id: string, type: 1 | 2, id: string, data: {
|
|
656
177
|
cookie?: string;
|
|
657
178
|
limit?: number;
|
|
658
179
|
}): Promise<any>;
|
|
659
|
-
/**
|
|
660
|
-
* ***********
|
|
661
|
-
* 音频api
|
|
662
|
-
* 音频接口:仅限音频类机器人才能使用,后续会根据机器人类型自动开通接口权限,现如需调用,需联系平台申请权限
|
|
663
|
-
* **********
|
|
664
|
-
*/
|
|
665
|
-
/**
|
|
666
|
-
* 音频控制
|
|
667
|
-
* @param channel_id 子频道id
|
|
668
|
-
* @param audio_url 音频url status为0时传
|
|
669
|
-
* @param status 0:开始 1:暂停 2:继续 3:停止
|
|
670
|
-
* @param text 状态文本(比如:简单爱-周杰伦),可选,status为0时传,其他操作不传
|
|
671
|
-
* @returns
|
|
672
|
-
*/
|
|
673
180
|
channelsAudioPost(channel_id: string, data: {
|
|
674
181
|
audio_url?: string;
|
|
675
182
|
text?: string;
|
|
676
183
|
status: 0 | 1 | 2 | 3;
|
|
677
184
|
}): Promise<any>;
|
|
678
|
-
/**
|
|
679
|
-
* 机器人上麦
|
|
680
|
-
* @param channel_id 语音子频道id
|
|
681
|
-
* @returns {}
|
|
682
|
-
*/
|
|
683
185
|
channelsMicPut(channel_id: string): Promise<any>;
|
|
684
|
-
/**
|
|
685
|
-
* 机器人下麦
|
|
686
|
-
* @param channel_id 语音子频道id
|
|
687
|
-
* @returns {}
|
|
688
|
-
*/
|
|
689
186
|
channelsMicDelete(channel_id: string): Promise<any>;
|
|
690
|
-
/**
|
|
691
|
-
* **********
|
|
692
|
-
* 帖子api
|
|
693
|
-
* 注意
|
|
694
|
-
* 公域机器人暂不支持申请,仅私域机器人可用,选择私域机器人后默认开通。
|
|
695
|
-
* 注意: 开通后需要先将机器人从频道移除,然后重新添加,方可生效。
|
|
696
|
-
* **********
|
|
697
|
-
*/
|
|
698
|
-
/**
|
|
699
|
-
* 获取帖子列表
|
|
700
|
-
* @param channel_id 子频道id
|
|
701
|
-
* @returns {threads:Thread[],is_finish:0|1}
|
|
702
|
-
* @returns 返回 Thread 对象数组(详见https://bot.q.qq.com/wiki/develop/api-v2/server-inter/channel/content/forum/model.html#Thread)
|
|
703
|
-
* @returns is_finish 为 1 时,表示已拉取完 为 0 时,表示未拉取完
|
|
704
|
-
*/
|
|
705
187
|
channelsThreads(channel_id: string): Promise<any>;
|
|
706
|
-
/**
|
|
707
|
-
* 获取帖子详情
|
|
708
|
-
* @param channel_id 子频道id
|
|
709
|
-
* @param thread_id 帖子id
|
|
710
|
-
* @returns 返回 帖子详情对象(详见https://bot.q.qq.com/wiki/develop/api-v2/server-inter/channel/content/forum/model.html#ThreadInfo)
|
|
711
|
-
* 其中content字段可参考 https://bot.q.qq.com/wiki/develop/api-v2/server-inter/channel/content/forum/model.html#RichText
|
|
712
|
-
*/
|
|
713
188
|
channelsThreadsThread(channel_id: string, thread_id: string): Promise<any>;
|
|
714
|
-
/**
|
|
715
|
-
* 发表帖子
|
|
716
|
-
* @param channel_id 子频道id
|
|
717
|
-
* @param title 帖子标题
|
|
718
|
-
* @param content 帖子内容
|
|
719
|
-
* @param format 帖子内容格式 1:纯文本 2:HTML 3:Markdown 4:JSON
|
|
720
|
-
* @returns 返回 {task_id:string,create_time:string} 其中 task_id 为帖子id,create_time 发帖时间戳
|
|
721
|
-
*/
|
|
722
189
|
channelsThreadsPut(channel_id: string, data: {
|
|
723
190
|
title: string;
|
|
724
191
|
content: string;
|
|
725
192
|
format: 1 | 2 | 3 | 4;
|
|
726
193
|
}): Promise<any>;
|
|
727
|
-
/**
|
|
728
|
-
* 删除帖子
|
|
729
|
-
* @param channel_id 子频道id
|
|
730
|
-
* @param thread_id 帖子id
|
|
731
|
-
* @returns
|
|
732
|
-
*/
|
|
733
194
|
channelsThreadsDelete(channel_id: string, thread_id: string): Promise<any>;
|
|
734
|
-
/**
|
|
735
|
-
* ********
|
|
736
|
-
* 接口权限api
|
|
737
|
-
* **********
|
|
738
|
-
*/
|
|
739
|
-
/**
|
|
740
|
-
* 获得频道可用权限列表
|
|
741
|
-
* @param guild_id
|
|
742
|
-
* @returns
|
|
743
|
-
*/
|
|
744
195
|
guildApiPermission(guild_id: string): Promise<any>;
|
|
745
|
-
|
|
746
|
-
* 交互事件回应
|
|
747
|
-
* @param interaction_id
|
|
748
|
-
* @param code
|
|
749
|
-
* @returns
|
|
750
|
-
*/
|
|
751
|
-
interactionResponse(mode: 'group' | 'guild', interaction_id: string, code?: number): Promise<any>;
|
|
196
|
+
interactionResponse(_mode: 'group' | 'guild', interaction_id: string, code?: number): Promise<any>;
|
|
752
197
|
}
|
|
753
|
-
|
|
754
|
-
export { QQBotAPI };
|