@alemonjs/qq-bot 2.1.33 → 2.1.35

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.
Files changed (132) hide show
  1. package/README.md +46 -8
  2. package/dist/assets/index.css +1 -1
  3. package/dist/assets/index.js +12 -5
  4. package/dist/index.html +1 -1
  5. package/lib/config.d.ts +44 -19
  6. package/lib/config.js +39 -35
  7. package/lib/desktop.d.ts +4 -1
  8. package/lib/desktop.js +53 -57
  9. package/lib/format.d.ts +26 -5
  10. package/lib/format.js +84 -101
  11. package/lib/hook.d.ts +82 -65
  12. package/lib/hook.js +35 -32
  13. package/lib/index.d.ts +6 -4
  14. package/lib/index.js +13 -16
  15. package/lib/index.webhook.d.ts +4 -1
  16. package/lib/index.webhook.js +12 -14
  17. package/lib/index.websoket.d.ts +6 -3
  18. package/lib/index.websoket.js +131 -41
  19. package/lib/message/AT_MESSAGE_CREATE.d.ts +36 -33
  20. package/lib/message/AT_MESSAGE_CREATE.js +1 -1
  21. package/lib/message/CHANNEL_CREATE.d.ts +17 -14
  22. package/lib/message/CHANNEL_CREATE.js +1 -1
  23. package/lib/message/CHANNEL_DELETE.d.ts +22 -14
  24. package/lib/message/CHANNEL_DELETE.js +1 -1
  25. package/lib/message/CHANNEL_UPDATE.d.ts +22 -14
  26. package/lib/message/CHANNEL_UPDATE.js +1 -1
  27. package/lib/message/DIRECT_MESSAGE_CREATE.d.ts +35 -27
  28. package/lib/message/DIRECT_MESSAGE_CREATE.js +1 -1
  29. package/lib/message/DIRECT_MESSAGE_DELETE.d.ts +23 -15
  30. package/lib/message/DIRECT_MESSAGE_DELETE.js +1 -1
  31. package/lib/message/ERROR.d.ts +4 -1
  32. package/lib/message/ERROR.js +1 -1
  33. package/lib/message/GUILD_CREATE.d.ts +22 -14
  34. package/lib/message/GUILD_CREATE.js +1 -1
  35. package/lib/message/GUILD_DELETE.d.ts +22 -14
  36. package/lib/message/GUILD_DELETE.js +1 -1
  37. package/lib/message/GUILD_MEMBER_ADD.d.ts +21 -13
  38. package/lib/message/GUILD_MEMBER_ADD.js +1 -1
  39. package/lib/message/GUILD_MEMBER_REMOVE.d.ts +21 -13
  40. package/lib/message/GUILD_MEMBER_REMOVE.js +1 -1
  41. package/lib/message/GUILD_MEMBER_UPDATE.d.ts +21 -13
  42. package/lib/message/GUILD_MEMBER_UPDATE.js +1 -1
  43. package/lib/message/GUILD_UPDATE.d.ts +22 -14
  44. package/lib/message/GUILD_UPDATE.js +1 -1
  45. package/lib/message/INTERACTION_CREATE.d.ts +52 -44
  46. package/lib/message/INTERACTION_CREATE.js +1 -1
  47. package/lib/message/MESSAGE_CREATE.d.ts +12 -1
  48. package/lib/message/MESSAGE_CREATE.js +1 -1
  49. package/lib/message/MESSAGE_DELETE.d.ts +12 -1
  50. package/lib/message/MESSAGE_DELETE.js +1 -1
  51. package/lib/message/MESSAGE_REACTION_ADD.d.ts +15 -12
  52. package/lib/message/MESSAGE_REACTION_ADD.js +1 -1
  53. package/lib/message/MESSAGE_REACTION_REMOVE.d.ts +15 -12
  54. package/lib/message/MESSAGE_REACTION_REMOVE.js +1 -1
  55. package/lib/message/PUBLIC_MESSAGE_DELETE.d.ts +20 -13
  56. package/lib/message/PUBLIC_MESSAGE_DELETE.js +1 -1
  57. package/lib/message/READY.d.ts +11 -5
  58. package/lib/message/READY.js +1 -1
  59. package/lib/message/group/C2C_MESSAGE_CREATE.d.ts +18 -15
  60. package/lib/message/group/C2C_MESSAGE_CREATE.js +1 -1
  61. package/lib/message/group/C2C_MSG_RECEIVE.d.ts +13 -3
  62. package/lib/message/group/C2C_MSG_RECEIVE.js +1 -1
  63. package/lib/message/group/C2C_MSG_REJECT.d.ts +9 -3
  64. package/lib/message/group/C2C_MSG_REJECT.js +1 -1
  65. package/lib/message/group/FRIEND_ADD.d.ts +13 -3
  66. package/lib/message/group/FRIEND_ADD.js +1 -1
  67. package/lib/message/group/FRIEND_DEL.d.ts +9 -3
  68. package/lib/message/group/FRIEND_DEL.js +1 -1
  69. package/lib/message/group/GROUP_ADD_ROBOT.d.ts +23 -4
  70. package/lib/message/group/GROUP_ADD_ROBOT.js +1 -1
  71. package/lib/message/group/GROUP_AT_MESSAGE_CREATE.d.ts +38 -32
  72. package/lib/message/group/GROUP_AT_MESSAGE_CREATE.js +1 -1
  73. package/lib/message/group/GROUP_DEL_ROBOT.d.ts +19 -4
  74. package/lib/message/group/GROUP_DEL_ROBOT.js +1 -1
  75. package/lib/message/group/GROUP_JOIN_REQUEST.d.ts +83 -22
  76. package/lib/message/group/GROUP_JOIN_REQUEST.js +1 -1
  77. package/lib/message/group/GROUP_MEMBER_ADD.d.ts +8 -5
  78. package/lib/message/group/GROUP_MEMBER_ADD.js +1 -1
  79. package/lib/message/group/GROUP_MEMBER_REMOVE.d.ts +8 -5
  80. package/lib/message/group/GROUP_MEMBER_REMOVE.js +1 -1
  81. package/lib/message/group/GROUP_MESSAGE_CREATE.d.ts +38 -32
  82. package/lib/message/group/GROUP_MESSAGE_CREATE.js +1 -1
  83. package/lib/message/group/GROUP_MSG_RECEIVE.d.ts +14 -4
  84. package/lib/message/group/GROUP_MSG_RECEIVE.js +1 -1
  85. package/lib/message/group/GROUP_MSG_REJECT.d.ts +10 -4
  86. package/lib/message/group/GROUP_MSG_REJECT.js +1 -1
  87. package/lib/message/group/MESSAGE_AUDIT_PASS.d.ts +12 -6
  88. package/lib/message/group/MESSAGE_AUDIT_PASS.js +1 -1
  89. package/lib/message/group/MESSAGE_AUDIT_REJECT.d.ts +12 -6
  90. package/lib/message/group/MESSAGE_AUDIT_REJECT.js +1 -1
  91. package/lib/register.d.ts +12 -9
  92. package/lib/register.js +1246 -1404
  93. package/lib/sdk/api.d.ts +937 -306
  94. package/lib/sdk/api.js +1481 -893
  95. package/lib/sdk/client.webhook.d.ts +25 -8
  96. package/lib/sdk/client.webhook.js +185 -189
  97. package/lib/sdk/client.websoket.d.ts +31 -9
  98. package/lib/sdk/client.websoket.js +369 -392
  99. package/lib/sdk/config.d.ts +6 -2
  100. package/lib/sdk/config.js +9 -6
  101. package/lib/sdk/instance.d.ts +11 -3
  102. package/lib/sdk/instance.js +72 -84
  103. package/lib/sdk/intents.d.ts +89 -3
  104. package/lib/sdk/intents.js +116 -33
  105. package/lib/sdk/message.d.ts +7 -4
  106. package/lib/sdk/message.group.d.ts +38 -35
  107. package/lib/sdk/message.group.js +1 -1
  108. package/lib/sdk/message.guild.d.ts +40 -37
  109. package/lib/sdk/message.guild.js +1 -1
  110. package/lib/sdk/message.js +1 -1
  111. package/lib/sdk/message.public.d.ts +8 -5
  112. package/lib/sdk/message.public.js +1 -1
  113. package/lib/sdk/qr-auth.d.ts +55 -0
  114. package/lib/sdk/qr-auth.js +166 -0
  115. package/lib/sdk/registry.d.ts +34 -24
  116. package/lib/sdk/registry.js +134 -114
  117. package/lib/sdk/session.d.ts +19 -15
  118. package/lib/sdk/session.js +51 -54
  119. package/lib/sdk/typing.d.ts +410 -184
  120. package/lib/sdk/typing.js +1 -1
  121. package/lib/sdk/webhook.secret.d.ts +33 -13
  122. package/lib/sdk/webhook.secret.js +50 -36
  123. package/lib/sends.d.ts +42 -25
  124. package/lib/sends.js +519 -541
  125. package/lib/types.d.ts +52 -41
  126. package/lib/types.js +1 -1
  127. package/lib/upload.d.ts +47 -18
  128. package/lib/upload.js +80 -51
  129. package/lib/utils.d.ts +9 -1
  130. package/lib/utils.js +10 -5
  131. package/package.json +10 -7
  132. package/LICENSE +0 -21
package/lib/sdk/api.d.ts CHANGED
@@ -1,310 +1,941 @@
1
- import { type AxiosRequestConfig } from 'axios';
2
- import { ApiRequestData, FileType, GroupAction, SetMemberMuteState, StreamMessageData, UploadPartFinishData, UploadPrepareData } from './typing.js';
3
- import { QQBotConfig } from './config.js';
4
- export declare const BOTS_API_RUL = "https://api.bot.qq.com";
5
- export declare const API_URL_SANDBOX = "https://sandbox.api.sgroup.qq.com";
6
- export declare const API_URL = "https://api.bot.qq.com";
7
- export type QQBotConnectionState = 'idle' | 'connecting' | 'ready' | 'reconnecting' | 'offline' | 'stopped';
8
- export type QQBotConnectionStatus = {
9
- state: QQBotConnectionState;
10
- transport: 'websocket' | 'webhook' | 'proxy' | null;
11
- reconnectAttempts: number;
12
- heartbeatAcknowledged: boolean;
13
- sessionId?: string;
14
- sequence?: number;
15
- resumed: boolean;
16
- lastError?: string;
1
+ import { ApiRequestData, FileType, GroupAction, SetMemberMuteState, StreamMessageData, UploadPartFinishData, UploadPrepareData } from "./typing.js";
2
+ import { QQBotConfig } from "./config.js";
3
+ import { AxiosRequestConfig } from "axios";
4
+ //#region src/sdk/api.d.ts
5
+ /** 获取访问凭证域名(统一为 api.bot.qq.com,同接口调用域名) */
6
+ declare const BOTS_API_RUL = "https://api.bot.qq.com";
7
+ declare const API_URL_SANDBOX = "https://sandbox.api.sgroup.qq.com";
8
+ /** 接口调用域名 */
9
+ declare const API_URL = "https://api.bot.qq.com";
10
+ type QQBotConnectionState = 'idle' | 'connecting' | 'ready' | 'reconnecting' | 'offline' | 'stopped';
11
+ type QQBotConnectionStatus = {
12
+ state: QQBotConnectionState;
13
+ transport: 'websocket' | 'webhook' | 'proxy' | null;
14
+ reconnectAttempts: number;
15
+ heartbeatAcknowledged: boolean;
16
+ sessionId?: string;
17
+ sequence?: number;
18
+ resumed: boolean;
19
+ lastError?: string;
17
20
  };
18
- export type QQBotMediaHashes = {
19
- sha256: string;
20
- md5: string;
21
- sha1: string;
22
- md5_10m: string;
21
+ type QQBotMediaHashes = {
22
+ sha256: string;
23
+ md5: string;
24
+ sha1: string;
25
+ md5_10m: string;
23
26
  };
24
- export declare class QQBotAPI {
25
- #private;
26
- protected readonly config: QQBotConfig;
27
- constructor(options?: Record<string, unknown>);
28
- getConnectionStatus(): QQBotConnectionStatus;
29
- protected updateConnectionStatus(patch: Partial<QQBotConnectionStatus>): void;
30
- setStreamLifecycleListener(listener?: (streamId: string) => void): void;
31
- sendTyping(params: {
32
- BotId?: string;
33
- userOpenId: string;
34
- msgId?: string;
35
- durationSec?: number;
36
- }): Promise<any>;
37
- streamOpen(params: {
38
- BotId?: string;
39
- userOpenId: string;
40
- msgId: string;
41
- eventId?: string;
42
- }): {
43
- streamId: `${string}-${string}-${string}-${string}-${string}`;
27
+ declare class QQBotAPI {
28
+ #private;
29
+ protected readonly config: QQBotConfig;
30
+ constructor(options?: Record<string, unknown>);
31
+ /** Read-only runtime snapshot, available through useClient<API>(). */
32
+ getConnectionStatus(): QQBotConnectionStatus;
33
+ protected updateConnectionStatus(patch: Partial<QQBotConnectionStatus>): void;
34
+ /** Subscribe to transport lifecycle changes without coupling consumers to a concrete QQ transport. */
35
+ setConnectionStatusListener(listener?: (status: QQBotConnectionStatus, previous: QQBotConnectionStatus) => void): void;
36
+ /** Internal transport hook used by the multi-bot registry to discard stale routes. */
37
+ setStreamLifecycleListener(listener?: (streamId: string) => void): void;
38
+ /** C2C-only input indicator. This is intentionally a QQ extension, not a core action. */
39
+ sendTyping(params: {
40
+ BotId?: string;
41
+ userOpenId: string;
42
+ msgId?: string;
43
+ durationSec?: number;
44
+ }): Promise<any>;
45
+ streamOpen(params: {
46
+ BotId?: string;
47
+ userOpenId: string;
48
+ msgId: string;
49
+ eventId?: string;
50
+ }): {
51
+ streamId: `${string}-${string}-${string}-${string}-${string}`;
52
+ };
53
+ streamUpdate(streamId: string, fullText: string): Promise<unknown>;
54
+ streamComplete(streamId: string): Promise<any>;
55
+ streamCancel(streamId: string): void;
56
+ /** Called by transports during shutdown so C2C streams cannot leak timers. */
57
+ protected cancelStreams(): void;
58
+ /**
59
+ * 得到鉴权
60
+ * @param app_id
61
+ * @param clientSecret
62
+ * @returns
63
+ */
64
+ getAuthentication(): Promise<any>;
65
+ /**
66
+ * 统一鉴权请求(QQBot AccessToken)
67
+ * @param options
68
+ * @returns
69
+ */
70
+ groupService(options: AxiosRequestConfig): Promise<any>;
71
+ /**
72
+ * @deprecated 使用 groupService 代替,鉴权方式已统一
73
+ */
74
+ guildServer(options: AxiosRequestConfig): Promise<any>;
75
+ /**
76
+ * 得到鉴权
77
+ * @returns
78
+ */
79
+ gateway(): Promise<any>;
80
+ /**
81
+ * 发送私聊消息
82
+ * @param openid
83
+ * @param content
84
+ * @param msg_id
85
+ * @returns
86
+ * 0 文本 1 图文 2 md 3 ark 4 embed
87
+ */
88
+ usersOpenMessages(openid: string, data: ApiRequestData): Promise<{
89
+ id: string;
90
+ timestamp: number;
91
+ }>;
92
+ /**
93
+ * 得到消息序列
94
+ * @param MessageId
95
+ * @returns
96
+ */
97
+ getMessageSeq(MessageId: string): number;
98
+ /**
99
+ * 发送群聊消息
100
+ * @param group_openid
101
+ * @param data
102
+ * @returns
103
+ */
104
+ groupOpenMessages(group_openid: string, data: ApiRequestData): Promise<{
105
+ id: string;
106
+ timestamp: number;
107
+ }>;
108
+ /**
109
+ * 发送私聊富媒体文件
110
+ * @param openid
111
+ * @param data
112
+ * @returns
113
+ * 1 图文 2 视频 3 语言 4 文件
114
+ * 图片:png/jpg,视频:mp4,语音:silk
115
+ */
116
+ postRichMediaByUser(openid: string, data: {
117
+ srv_send_msg?: boolean;
118
+ file_type: FileType;
119
+ url?: string;
120
+ file_data?: any;
121
+ upload_id?: string;
122
+ file_name?: string;
123
+ }): Promise<{
124
+ file_uuid: string;
125
+ file_info: string;
126
+ ttl: number;
127
+ id?: string;
128
+ raw_url?: string;
129
+ }>;
130
+ /**
131
+ * 发送群里文件
132
+ * @param openid
133
+ * @param data
134
+ * @returns
135
+ * 1 图文 2 视频 3 语言 4 文件
136
+ * 图片:png/jpg,视频:mp4,语音:silk
137
+ */
138
+ postRichMediaByGroup(openid: string, data: {
139
+ srv_send_msg?: boolean;
140
+ file_type: FileType;
141
+ url?: string;
142
+ file_data?: any;
143
+ upload_id?: string;
144
+ file_name?: string;
145
+ }): Promise<{
146
+ file_uuid: string;
147
+ file_info: string;
148
+ ttl: number;
149
+ id?: string;
150
+ raw_url?: string;
151
+ }>;
152
+ /** Produces upload and cache hashes without materialising the file in memory. */
153
+ getMediaFileHashes(filePath: string): Promise<QQBotMediaHashes>;
154
+ /**
155
+ * QQ's large-file protocol: prepare -> COS PUT -> part finish -> complete.
156
+ * A local path is read one part at a time, including retry attempts.
157
+ */
158
+ postChunkedRichMedia(params: {
159
+ scope: 'group' | 'c2c';
160
+ targetId: string;
161
+ fileType: FileType;
162
+ data?: Buffer;
163
+ filePath?: string;
164
+ size?: number;
165
+ hashes?: QQBotMediaHashes;
166
+ name?: string;
167
+ onProgress?: (uploaded: number, total: number) => void;
168
+ }): Promise<{
169
+ file_uuid: string;
170
+ file_info: string;
171
+ ttl: number;
172
+ }>;
173
+ /**
174
+ *
175
+ * @param openid
176
+ * @param message_id
177
+ * @returns
178
+ */
179
+ userMessageDelete(openid: string, message_id: string): Promise<any>;
180
+ /**
181
+ * 群聊-撤回消息
182
+ * @param group_openid 群 OpenID
183
+ * @param message_id 消息 ID
184
+ */
185
+ groupMessageDelete(group_openid: string, message_id: string): Promise<any>;
186
+ /**
187
+ * @deprecated 方法名拼写错误,请使用 groupMessageDelete 代替
188
+ * @param group_openid 群 OpenID
189
+ * @param message_id 消息 ID
190
+ */
191
+ grouMessageDelte(group_openid: string, message_id: string): Promise<any>;
192
+ /**
193
+ * 获取群基本信息
194
+ * @param group_openid 群 OpenID
195
+ */
196
+ groupsInfo(group_openid: string): Promise<any>;
197
+ /**
198
+ * 获取机器人群内状态
199
+ * @param group_openid 群 OpenID
200
+ */
201
+ groupsBotState(group_openid: string): Promise<any>;
202
+ /**
203
+ * 获取群成员详情
204
+ * @param group_openid 群 OpenID
205
+ * @param member_openid 群成员的 openid
206
+ */
207
+ groupsMembersMessage(group_openid: string, member_openid: string): Promise<any>;
208
+ /**
209
+ * 拉取入群申请列表
210
+ * @param group_openid 群 OpenID
211
+ * @param params 分页参数
212
+ */
213
+ groupsJoinRequestList(group_openid: string, params?: {
214
+ cursor?: string;
215
+ limit?: number;
216
+ }): Promise<any>;
217
+ /**
218
+ * 审批入群申请
219
+ * @param group_openid 群 OpenID
220
+ * @param member_openid 成员 OpenID
221
+ * @param data 审批参数
222
+ */
223
+ groupsApprovalJoinRequest(group_openid: string, member_openid: string, data: {
224
+ op: 'approve' | 'decline';
225
+ join_request_id?: string;
226
+ reject_reason?: string;
227
+ add_to_member_blacklist?: boolean;
228
+ }): Promise<any>;
229
+ /**
230
+ * 查询群禁言状态
231
+ * @param group_openid 群 OpenID
232
+ */
233
+ groupsRestrictChatSetting(group_openid: string): Promise<any>;
234
+ /**
235
+ * 设置群成员禁言
236
+ * @param group_openid 群 OpenID
237
+ * @param data 禁言设置
238
+ */
239
+ groupsRestrictChatSettingPost(group_openid: string, data: {
240
+ members?: SetMemberMuteState[];
241
+ }): Promise<any>;
242
+ /**
243
+ * 查询入群自动审批策略列表
244
+ * @param params 分页参数
245
+ */
246
+ groupsJoinApprovalStrategies(params?: {
247
+ cursor?: string;
248
+ limit?: number;
249
+ }): Promise<any>;
250
+ /**
251
+ * 创建入群自动审批策略
252
+ * @param data 策略参数
253
+ */
254
+ groupsJoinApprovalStrategyCreate(data: {
255
+ group_openids?: string[];
256
+ group_ids?: string[];
257
+ is_enable?: 'on' | 'off';
258
+ expire_at?: string;
259
+ remark?: string;
260
+ }): Promise<any>;
261
+ /**
262
+ * 修改入群自动审批策略
263
+ * @param strategy_id 策略 ID
264
+ * @param data 修改参数
265
+ */
266
+ groupsJoinApprovalStrategyPatch(strategy_id: string, data: {
267
+ is_enable?: 'on' | 'off';
268
+ expire_at?: string;
269
+ group_action?: GroupAction;
270
+ remark?: string;
271
+ }): Promise<any>;
272
+ /**
273
+ * 删除入群自动审批策略
274
+ * @param strategy_id 策略 ID
275
+ */
276
+ groupsJoinApprovalStrategyDelete(strategy_id: string): Promise<any>;
277
+ /**
278
+ * 执行入群自动审批策略
279
+ * @param strategy_id 策略 ID
280
+ */
281
+ groupsJoinApprovalStrategyExecute(strategy_id: string): Promise<any>;
282
+ /**
283
+ * 修改入群自动审批策略白名单
284
+ * @param strategy_id 策略 ID
285
+ * @param data 白名单参数
286
+ */
287
+ groupsJoinApprovalStrategyWhitelistUsers(strategy_id: string, data: {
288
+ op: 'add' | 'del';
289
+ whitelist_users: string[];
290
+ }): Promise<any>;
291
+ /**
292
+ * 单聊-分片上传准备
293
+ * @param userId 用户 OpenID
294
+ * @param data 上传准备参数
295
+ */
296
+ usersUploadPrepare(userId: string, data: UploadPrepareData): Promise<any>;
297
+ /**
298
+ * 群聊-分片上传准备
299
+ * @param groupId 群 OpenID
300
+ * @param data 上传准备参数
301
+ */
302
+ groupUploadPrepare(groupId: string, data: UploadPrepareData): Promise<any>;
303
+ /**
304
+ * 单聊-分片完成
305
+ * @param userId 用户 OpenID
306
+ * @param data 分片完成参数
307
+ */
308
+ usersUploadPartFinish(userId: string, data: UploadPartFinishData): Promise<any>;
309
+ /**
310
+ * 群聊-分片完成
311
+ * @param groupId 群 OpenID
312
+ * @param data 分片完成参数
313
+ */
314
+ groupUploadPartFinish(groupId: string, data: UploadPartFinishData): Promise<any>;
315
+ /**
316
+ * 分片字节直传(COS 预签名地址)
317
+ * 注意:不能用 groupService,预签名地址已自带鉴权,
318
+ * 额外携带 QQ 鉴权头会导致 COS 签名校验失败
319
+ * @param presignedUrl 预签名上传地址
320
+ * @param part 分片内容
321
+ */
322
+ uploadPartDirect(presignedUrl: string, part: Buffer): Promise<import("axios").AxiosResponse<any, any, {}>>;
323
+ /**
324
+ * 单聊-流式消息
325
+ * @param userId 用户 OpenID
326
+ * @param data 流式消息参数
327
+ */
328
+ streamMessages(userId: string, data: StreamMessageData): Promise<any>;
329
+ /**
330
+ * ************
331
+ * 消息-图片接口
332
+ * ***********
333
+ */
334
+ /**
335
+ *
336
+ * @param channel_id
337
+ * @param message
338
+ * @param image
339
+ * @returns
340
+ */
341
+ channelsMessages(channel_id: string, message: {
342
+ content?: string;
343
+ embed?: any;
344
+ ark?: any;
345
+ message_reference?: any;
346
+ image?: string;
347
+ msg_id?: string;
348
+ event_id?: string;
349
+ markdown?: any;
350
+ }, image?: Buffer): Promise<any>;
351
+ /**
352
+ * 私聊发送
353
+ * @param id 私信传频道id,公信传子频道id
354
+ * @param message {消息编号,图片,内容}
355
+ * @returns
356
+ */
357
+ dmsMessages(guild_id: string, message: {
358
+ content?: string;
359
+ embed?: any;
360
+ ark?: any;
361
+ message_reference?: any;
362
+ image?: string;
363
+ msg_id?: string;
364
+ event_id?: string;
365
+ markdown?: any;
366
+ }, image?: Buffer): Promise<any>;
367
+ /**
368
+ * ********
369
+ * 用户api
370
+ * *******
371
+ */
372
+ /**
373
+ * 获取用户详情
374
+ * @param message
375
+ * @returns
376
+ */
377
+ usersMe(): Promise<any>;
378
+ /**
379
+ * 获取用户频道列表
380
+ * @param message
381
+ * @returns
382
+ */
383
+ usersMeGuilds(params: {
384
+ before: string;
385
+ after: string;
386
+ limit: number;
387
+ }): Promise<any>;
388
+ /**
389
+ * **********
390
+ * 频道api
391
+ * **********
392
+ */
393
+ /**
394
+ * 获取频道详细
395
+ * @param guild_id
396
+ * @returns
397
+ */
398
+ guilds(guild_id: string): Promise<any>;
399
+ /**
400
+ * ************
401
+ * 子频道api
402
+ * ***********
403
+ */
404
+ /**
405
+ * 获取子频道列表
406
+ * @param guild_id
407
+ * @returns
408
+ */
409
+ guildsChannels(guild_id: string): Promise<any>;
410
+ /**
411
+ * 获取子频道详情
412
+ * @param channel_id
413
+ * @returns
414
+ */
415
+ channels(channel_id: string): Promise<any>;
416
+ /**
417
+ * 创建子频道
418
+ * @param guild_id
419
+ * @returns
420
+ */
421
+ guildsChannelsCreate(guild_id: string, data: {
422
+ name: string;
423
+ type?: number;
424
+ sub_type?: number;
425
+ position?: number;
426
+ parent_id?: string;
427
+ private_type?: number;
428
+ private_user_ids?: string[];
429
+ speak_permission?: number;
430
+ application_id?: string;
431
+ }): Promise<any>;
432
+ /**
433
+ * 创建子频道
434
+ * @param channel_id
435
+ * @returns
436
+ */
437
+ guildsChannelsUpdate(channel_id: string, data: {
438
+ name?: string;
439
+ position?: number;
440
+ parent_id?: string;
441
+ private_type?: number;
442
+ speak_permission?: number;
443
+ }): Promise<any>;
444
+ /**
445
+ * 删除子频道
446
+ * @param channel_id
447
+ * @param data
448
+ * @returns
449
+ */
450
+ guildsChannelsdelete(channel_id: string, data?: {
451
+ name?: string;
452
+ position?: number;
453
+ parent_id?: string;
454
+ private_type?: number;
455
+ speak_permission?: number;
456
+ }): Promise<any>;
457
+ /**
458
+ * 获取在线成员数
459
+ * @param channel_id
460
+ * @returns
461
+ */
462
+ channelsChannelOnlineNums(channel_id: string): Promise<any>;
463
+ /**
464
+ * *********
465
+ * 成员api
466
+ * *********
467
+ */
468
+ /**
469
+ * 获取频道成员列表
470
+ * @param guild_id
471
+ * @returns
472
+ */
473
+ guildsMembers(guild_id: string, params: {
474
+ after: string;
475
+ limit: number;
476
+ }): Promise<any>;
477
+ /**
478
+ * 获取频道身份组成员列表
479
+ * @param guild_id
480
+ * @param role_id
481
+ * @param params
482
+ * @returns
483
+ */
484
+ guildsRolesMembers(guild_id: string, role_id: string, params: {
485
+ start_index: string;
486
+ limit: number;
487
+ }): Promise<any>;
488
+ /**
489
+ * 获取成员详情
490
+ * @param guild_id
491
+ * @param user_id
492
+ * @returns
493
+ */
494
+ guildsMembersMessage(guild_id: string, user_id: string): Promise<any>;
495
+ /**
496
+ * 删除频道成员
497
+ * @param guild_id
498
+ * @param user_id
499
+ * @returns
500
+ */
501
+ guildsMembersDelete(guild_id: string, user_id: string): Promise<any>;
502
+ /**
503
+ * 获取指定消息
504
+ * @param channel_id
505
+ * @param message_id
506
+ * @returns
507
+ */
508
+ channelsMessagesById(channel_id: string, message_id: string): Promise<any>;
509
+ /**
510
+ * 撤回消息
511
+ * @param channel_id
512
+ * @param message_id
513
+ * @param hidetip
514
+ * @returns
515
+ */
516
+ channelsMessagesDelete(channel_id: string, message_id: string, hidetip?: boolean): Promise<any>;
517
+ /**
518
+ * ***********
519
+ * 频道身份api
520
+ * ***********
521
+ */
522
+ /**
523
+ * 获取频道身份组列表
524
+ * @param guild_id 频道id
525
+ * @returns
526
+ */
527
+ guildsRoles(guild_id: string): Promise<any>;
528
+ /**
529
+ * 创建频道身份组
530
+ * @param guild_id 频道id
531
+ * @param {object} data 参数
532
+ * @param {object?} data.name 身份组名称
533
+ * @param {object?} data.color ARGB 的 HEX 十六进制颜色值转换后的十进制数值
534
+ * @param {object?} data.hoist 在成员列表中单独展示: 0-否, 1-是
535
+ * @returns
536
+ */
537
+ guildsRolesPost(guild_id: string, data: {
538
+ name?: string;
539
+ color?: number;
540
+ hoist?: 0 | 1;
541
+ }): Promise<any>;
542
+ /**
543
+ * 修改频道身份组
544
+ * @param guild_id 频道id
545
+ * @param {object} data 参数
546
+ * @param {object?} data.name 身份组名称
547
+ * @param {object?} data.color ARGB 的 HEX 十六进制颜色值转换后的十进制数值
548
+ * @param {object?} data.hoist 在成员列表中单独展示: 0-否, 1-是
549
+ * @returns
550
+ */
551
+ guildsRolesPatch(guild_id: string, role_id: string, data: {
552
+ name?: string;
553
+ color?: number;
554
+ hoist?: 0 | 1;
555
+ }): Promise<any>;
556
+ /**
557
+ * 删除频道身份组
558
+ * @param guild_id 频道id
559
+ * @param role_id 身份组id
560
+ */
561
+ guildsRolesDelete(guild_id: string, role_id: string): Promise<any>;
562
+ /**
563
+ * 将成员添加到频道身份组
564
+ * @param guild_id 频道id
565
+ * @param channel_id 子频道id
566
+ * @param user_id 用户id
567
+ * @param role_id 身份组id
568
+ * @returns
569
+ */
570
+ guildsRolesMembersPut(guild_id: string, channel_id: string, user_id: string, role_id: string): Promise<any>;
571
+ /**
572
+ * 将成员从频道身份组移除
573
+ * @param guild_id 频道id
574
+ * @param channel_id 子频道id
575
+ * @param user_id 用户id
576
+ * @param role_id 身份组id
577
+ * @returns
578
+ */
579
+ guildsRolesMembersDelete(guild_id: string, channel_id: string, user_id: string, role_id: string): Promise<any>;
580
+ /**
581
+ * **********
582
+ * 子频道权限api
583
+ * **********
584
+ */
585
+ /**
586
+ * 获取子频道用户权限
587
+ * @param channel_id 子频道id
588
+ * @param user_id 用户id
589
+ */
590
+ channelsPermissions(channel_id: string, user_id: string): Promise<any>;
591
+ /**
592
+ * 修改子频道用户权限
593
+ * @param channel_id 子频道id
594
+ * @param user_id 用户id
595
+ * @param 参数包括add和remove两个字段分别表示授予的权限以及删除的权限。要授予用户权限即把add对应位置 1,删除用户权限即把remove对应位置 1。当两个字段同一位都为 1,表现为删除权限。
596
+ */
597
+ channelsPermissionsPut(channel_id: string, user_id: string, add: string, remove: string): Promise<any>;
598
+ /**
599
+ * *******
600
+ * 消息api
601
+ * ********
602
+ */
603
+ /**
604
+ * ************
605
+ * 消息频率api
606
+ * **********
607
+ */
608
+ /**
609
+ * 查询频道消息频率限制
610
+ * @param guild_id 频道id
611
+ * @returns
612
+ */
613
+ guildsMessageSetting(guild_id: string): Promise<any>;
614
+ /**
615
+ * ***********
616
+ * 私信api
617
+ * **********
618
+ */
619
+ /**
620
+ * 创建私信会话
621
+ * @param recipient_id 接收者 id
622
+ * @param source_guild_id 源频道 id
623
+ * @returns
624
+ */
625
+ usersMeDms(): Promise<any>;
626
+ /**
627
+ * 撤回私信
628
+ * @param guild_id
629
+ * @param data
630
+ * @returns
631
+ */
632
+ dmsMessageDelete(guild_id: string, message_id: string, hidetip?: boolean): Promise<any>;
633
+ /**
634
+ * *********
635
+ * 禁言api
636
+ * *******
637
+ */
638
+ /**
639
+ * 全体禁言(非管理员)
640
+ * @param guild_id 频道id
641
+ * @param data { mute_end_timestamp:禁言结束时间戳, mute_seconds:禁言时长 } 两个参数必须传一个 优先级 mute_end_timestamp > mute_seconds
642
+ * 将mute_end_timestamp或mute_seconds传值为字符串'0',则表示解除全体禁言
643
+ */
644
+ guildsMuteAll(guild_id: string, data: {
645
+ mute_end_timestamp?: string;
646
+ mute_seconds?: string;
647
+ }): Promise<any>;
648
+ /**
649
+ * 频道指定成员禁言
650
+ * @param guild_id 频道id
651
+ * @param user_id 用户id
652
+ * @param data { mute_end_timestamp:禁言结束时间戳, mute_seconds:禁言时长 } 两个参数必须传一个 优先级 mute_end_timestamp > mute_seconds
653
+ * 将mute_end_timestamp或mute_seconds传值为字符串'0',则表示解除禁言
654
+ * @returns
655
+ */
656
+ guildsMemberMute(guild_id: string, user_id: string, data: {
657
+ mute_end_timestamp?: string;
658
+ mute_seconds?: string;
659
+ }): Promise<any>;
660
+ /**
661
+ * 频道批量禁言
662
+ * @param guild_id 频道id
663
+ * @param data { mute_end_timestamp:禁言结束时间戳, mute_seconds:禁言时长, user_ids:用户id数组 } 两个参数必须传一个 优先级 mute_end_timestamp > mute_seconds
664
+ * 将mute_end_timestamp或mute_seconds传值为字符串'0',则表示解除禁言
665
+ */
666
+ guildsMute(guild_id: string, data: {
667
+ mute_end_timestamp?: string;
668
+ mute_seconds?: string;
669
+ user_ids: string[];
670
+ }): Promise<any>;
671
+ /**
672
+ * *******
673
+ * 公告api
674
+ * *******
675
+ */
676
+ /**
677
+ * 创建频道公告
678
+ * 公告类型分为 消息类型的频道公告 和 推荐子频道类型的频道公告
679
+ * 详见 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
680
+ * @param guild_id 频道id
681
+ * @param data { message_id:消息id, channel_id:频道id, announces_type:公告类型, recommend_channels:推荐频道id数组 }
682
+ * @param channel_id 子频道id 消息id存在时必须传
683
+ * @param announces_type 0:成员公告 1:欢迎公告 默认为 0
684
+ * @param recommend_channels 推荐频道id数组 "recommend_channels": [{ "channel_id": "xxxx","introduce": "推荐语" }]
685
+ * @returns 返回Announces 对象 (https://bot.q.qq.com/wiki/develop/api-v2/server-inter/channel/content/announces/model.html#Announces)
686
+ */
687
+ guildsAnnounces(guild_id: string, data: {
688
+ message_id?: string;
689
+ channel_id?: string;
690
+ announces_type?: 0 | 1;
691
+ recommend_channels?: string[];
692
+ }): Promise<any>;
693
+ /**
694
+ * 删除频道公告
695
+ * @param guild_id 频道id
696
+ * @param message_id 消息id message_id 有值时,会校验 message_id 合法性,若不校验校验 message_id,请将 message_id 设置为 all
697
+ * @returns
698
+ */
699
+ guildsAnnouncesDelete(guild_id: string, message_id: string): Promise<any>;
700
+ /**
701
+ * **********
702
+ * 精华消息api
703
+ * **********
704
+ */
705
+ /**
706
+ * 添加精华消息
707
+ * @param channel_id 频道id
708
+ * @param message_id 消息id
709
+ * @returns 返回 PinsMessage对象 { "guild_id": "xxxxxx", "channel_id": "xxxxxx", "message_ids": ["xxxxx"]}
710
+ * @returns message_ids 为当前请求后子频道内所有精华消息 message_id 数组
711
+ */
712
+ channelsPinsPut(channel_id: string, message_id: string): Promise<any>;
713
+ /**
714
+ * 删除精华消息
715
+ * @param channel_id 子频道id
716
+ * @param message_id 消息id
717
+ * 删除子频道内全部精华消息,请将 message_id 设置为 all
718
+ * @returns
719
+ */
720
+ channelsPinsDelete(channel_id: string, message_id: string): Promise<any>;
721
+ /**
722
+ * 获取精华消息
723
+ * @param channel_id 子频道id
724
+ * @returns 返回 PinsMessage对象 { "guild_id": "xxxxxx", "channel_id": "xxxxxx", "message_ids": ["xxxxx"]}
725
+ * @returns message_ids 为当前请求后子频道内所有精华消息 message_id 数组
726
+ */
727
+ channelsPins(channel_id: string): Promise<any>;
728
+ /**
729
+ * ********
730
+ * 日程api
731
+ * *******
732
+ */
733
+ /**
734
+ * 获取频道日程列表
735
+ * @param channel_id 子频道id
736
+ * @returns 返回 Schedule 对象数组(详见https://bot.q.qq.com/wiki/develop/api-v2/server-inter/channel/content/schedule/model.html#schedule)
737
+ */
738
+ channelsSchedules(channel_id: string): Promise<any>;
739
+ /**
740
+ * 获取频道日程详情
741
+ * @param channel_id 子频道id
742
+ * @param schedule_id 日程id
743
+ * @returns 返回 Schedule 对象(详见https://bot.q.qq.com/wiki/develop/api-v2/server-inter/channel/content/schedule/model.html#schedule)
744
+ */
745
+ channelsSchedulesSchedule(channel_id: string, schedule_id: string): Promise<any>;
746
+ /**
747
+ * 创建频道日程
748
+ * @param channel_id 子频道id
749
+ * @param name 日程名称
750
+ * @param description 日程描述
751
+ * @param start_timestamp 日程开始时间戳
752
+ * @param end_timestamp 日程结束时间戳
753
+ * @param jump_channel_id 日程开始时跳转的子频道id
754
+ * @param remind_type 日程提醒类型
755
+ * 0不提醒
756
+ * 1开始时提醒
757
+ * 2开始前 5 分钟提醒
758
+ * 3开始前 15 分钟提醒
759
+ * 4开始前 30 分钟提醒
760
+ * 5开始前 60 分钟提醒
761
+ * @returns 返回 Schedule 对象(详见https://bot.q.qq.com/wiki/develop/api-v2/server-inter/channel/content/schedule/model.html#schedule)
762
+ */
763
+ channelsSchedulesPost(channel_id: string, data: {
764
+ schedule: {
765
+ name: string;
766
+ description?: string;
767
+ start_timestamp: string;
768
+ end_timestamp: string;
769
+ jump_channel_id: string;
770
+ remind_type: number;
44
771
  };
45
- streamUpdate(streamId: string, fullText: string): Promise<unknown>;
46
- streamComplete(streamId: string): Promise<any>;
47
- streamCancel(streamId: string): void;
48
- protected cancelStreams(): void;
49
- getAuthentication(): Promise<any>;
50
- groupService(options: AxiosRequestConfig): Promise<any>;
51
- guildServer(options: AxiosRequestConfig): Promise<any>;
52
- gateway(): Promise<any>;
53
- usersOpenMessages(openid: string, data: ApiRequestData): Promise<{
54
- id: string;
55
- timestamp: number;
56
- }>;
57
- getMessageSeq(MessageId: string): number;
58
- groupOpenMessages(group_openid: string, data: ApiRequestData): Promise<{
59
- id: string;
60
- timestamp: number;
61
- }>;
62
- postRichMediaByUser(openid: string, data: {
63
- srv_send_msg?: boolean;
64
- file_type: FileType;
65
- url?: string;
66
- file_data?: any;
67
- upload_id?: string;
68
- file_name?: string;
69
- }): Promise<{
70
- file_uuid: string;
71
- file_info: string;
72
- ttl: number;
73
- id?: string;
74
- raw_url?: string;
75
- }>;
76
- postRichMediaByGroup(openid: string, data: {
77
- srv_send_msg?: boolean;
78
- file_type: FileType;
79
- url?: string;
80
- file_data?: any;
81
- upload_id?: string;
82
- file_name?: string;
83
- }): Promise<{
84
- file_uuid: string;
85
- file_info: string;
86
- ttl: number;
87
- id?: string;
88
- raw_url?: string;
89
- }>;
90
- getMediaFileHashes(filePath: string): Promise<QQBotMediaHashes>;
91
- postChunkedRichMedia(params: {
92
- scope: 'group' | 'c2c';
93
- targetId: string;
94
- fileType: FileType;
95
- data?: Buffer;
96
- filePath?: string;
97
- size?: number;
98
- hashes?: QQBotMediaHashes;
99
- name?: string;
100
- onProgress?: (uploaded: number, total: number) => void;
101
- }): Promise<{
102
- file_uuid: string;
103
- file_info: string;
104
- ttl: number;
105
- }>;
106
- userMessageDelete(openid: string, message_id: string): Promise<any>;
107
- groupMessageDelete(group_openid: string, message_id: string): Promise<any>;
108
- grouMessageDelte(group_openid: string, message_id: string): Promise<any>;
109
- groupsInfo(group_openid: string): Promise<any>;
110
- groupsBotState(group_openid: string): Promise<any>;
111
- groupsMembersMessage(group_openid: string, member_openid: string): Promise<any>;
112
- groupsJoinRequestList(group_openid: string, params?: {
113
- cursor?: string;
114
- limit?: number;
115
- }): Promise<any>;
116
- groupsApprovalJoinRequest(group_openid: string, member_openid: string, data: {
117
- op: 'approve' | 'decline';
118
- join_request_id?: string;
119
- reject_reason?: string;
120
- add_to_member_blacklist?: boolean;
121
- }): Promise<any>;
122
- groupsRestrictChatSetting(group_openid: string): Promise<any>;
123
- groupsRestrictChatSettingPost(group_openid: string, data: {
124
- members?: SetMemberMuteState[];
125
- }): Promise<any>;
126
- groupsJoinApprovalStrategies(params?: {
127
- cursor?: string;
128
- limit?: number;
129
- }): Promise<any>;
130
- groupsJoinApprovalStrategyCreate(data: {
131
- group_openids?: string[];
132
- group_ids?: string[];
133
- is_enable?: 'on' | 'off';
134
- expire_at?: string;
135
- remark?: string;
136
- }): Promise<any>;
137
- groupsJoinApprovalStrategyPatch(strategy_id: string, data: {
138
- is_enable?: 'on' | 'off';
139
- expire_at?: string;
140
- group_action?: GroupAction;
141
- remark?: string;
142
- }): Promise<any>;
143
- groupsJoinApprovalStrategyDelete(strategy_id: string): Promise<any>;
144
- groupsJoinApprovalStrategyExecute(strategy_id: string): Promise<any>;
145
- groupsJoinApprovalStrategyWhitelistUsers(strategy_id: string, data: {
146
- op: 'add' | 'del';
147
- whitelist_users: string[];
148
- }): Promise<any>;
149
- usersUploadPrepare(userId: string, data: UploadPrepareData): Promise<any>;
150
- groupUploadPrepare(groupId: string, data: UploadPrepareData): Promise<any>;
151
- usersUploadPartFinish(userId: string, data: UploadPartFinishData): Promise<any>;
152
- groupUploadPartFinish(groupId: string, data: UploadPartFinishData): Promise<any>;
153
- uploadPartDirect(presignedUrl: string, part: Buffer): Promise<import("axios").AxiosResponse<any, any, {}>>;
154
- streamMessages(userId: string, data: StreamMessageData): Promise<any>;
155
- channelsMessages(channel_id: string, message: {
156
- content?: string;
157
- embed?: any;
158
- ark?: any;
159
- message_reference?: any;
160
- image?: string;
161
- msg_id?: string;
162
- event_id?: string;
163
- markdown?: any;
164
- }, image?: Buffer): Promise<any>;
165
- dmsMessages(guild_id: string, message: {
166
- content?: string;
167
- embed?: any;
168
- ark?: any;
169
- message_reference?: any;
170
- image?: string;
171
- msg_id?: string;
172
- event_id?: string;
173
- markdown?: any;
174
- }, image?: Buffer): Promise<any>;
175
- usersMe(): Promise<any>;
176
- usersMeGuilds(params: {
177
- before: string;
178
- after: string;
179
- limit: number;
180
- }): Promise<any>;
181
- guilds(guild_id: string): Promise<any>;
182
- guildsChannels(guild_id: string): Promise<any>;
183
- channels(channel_id: string): Promise<any>;
184
- guildsChannelsCreate(guild_id: string, data: {
185
- name: string;
186
- type?: number;
187
- sub_type?: number;
188
- position?: number;
189
- parent_id?: string;
190
- private_type?: number;
191
- private_user_ids?: string[];
192
- speak_permission?: number;
193
- application_id?: string;
194
- }): Promise<any>;
195
- guildsChannelsUpdate(channel_id: string, data: {
196
- name?: string;
197
- position?: number;
198
- parent_id?: string;
199
- private_type?: number;
200
- speak_permission?: number;
201
- }): Promise<any>;
202
- guildsChannelsdelete(channel_id: string, data?: {
203
- name?: string;
204
- position?: number;
205
- parent_id?: string;
206
- private_type?: number;
207
- speak_permission?: number;
208
- }): Promise<any>;
209
- channelsChannelOnlineNums(channel_id: string): Promise<any>;
210
- guildsMembers(guild_id: string, params: {
211
- after: string;
212
- limit: number;
213
- }): Promise<any>;
214
- guildsRolesMembers(guild_id: string, role_id: string, params: {
215
- start_index: string;
216
- limit: number;
217
- }): Promise<any>;
218
- guildsMembersMessage(guild_id: string, user_id: string): Promise<any>;
219
- guildsMembersDelete(guild_id: string, user_id: string): Promise<any>;
220
- channelsMessagesById(channel_id: string, message_id: string): Promise<any>;
221
- channelsMessagesDelete(channel_id: string, message_id: string, hidetip?: boolean): Promise<any>;
222
- guildsRoles(guild_id: string): Promise<any>;
223
- guildsRolesPost(guild_id: string, data: {
224
- name?: string;
225
- color?: number;
226
- hoist?: 0 | 1;
227
- }): Promise<any>;
228
- guildsRolesPatch(guild_id: string, role_id: string, data: {
229
- name?: string;
230
- color?: number;
231
- hoist?: 0 | 1;
232
- }): Promise<any>;
233
- guildsRolesDelete(guild_id: string, role_id: string): Promise<any>;
234
- guildsRolesMembersPut(guild_id: string, channel_id: string, user_id: string, role_id: string): Promise<any>;
235
- guildsRolesMembersDelete(guild_id: string, channel_id: string, user_id: string, role_id: string): Promise<any>;
236
- channelsPermissions(channel_id: string, user_id: string): Promise<any>;
237
- channelsPermissionsPut(channel_id: string, user_id: string, add: string, remove: string): Promise<any>;
238
- guildsMessageSetting(guild_id: string): Promise<any>;
239
- usersMeDms(): Promise<any>;
240
- dmsMessageDelete(guild_id: string, message_id: string, hidetip?: boolean): Promise<any>;
241
- guildsMuteAll(guild_id: string, data: {
242
- mute_end_timestamp?: string;
243
- mute_seconds?: string;
244
- }): Promise<any>;
245
- guildsMemberMute(guild_id: string, user_id: string, data: {
246
- mute_end_timestamp?: string;
247
- mute_seconds?: string;
248
- }): Promise<any>;
249
- guildsMute(guild_id: string, data: {
250
- mute_end_timestamp?: string;
251
- mute_seconds?: string;
252
- user_ids: string[];
253
- }): Promise<any>;
254
- guildsAnnounces(guild_id: string, data: {
255
- message_id?: string;
256
- channel_id?: string;
257
- announces_type?: 0 | 1;
258
- recommend_channels?: string[];
259
- }): Promise<any>;
260
- guildsAnnouncesDelete(guild_id: string, message_id: string): Promise<any>;
261
- channelsPinsPut(channel_id: string, message_id: string): Promise<any>;
262
- channelsPinsDelete(channel_id: string, message_id: string): Promise<any>;
263
- channelsPins(channel_id: string): Promise<any>;
264
- channelsSchedules(channel_id: string): Promise<any>;
265
- channelsSchedulesSchedule(channel_id: string, schedule_id: string): Promise<any>;
266
- channelsSchedulesPost(channel_id: string, data: {
267
- schedule: {
268
- name: string;
269
- description?: string;
270
- start_timestamp: string;
271
- end_timestamp: string;
272
- jump_channel_id: string;
273
- remind_type: number;
274
- };
275
- }): Promise<any>;
276
- channelsSchedulesSchedulePatch(channel_id: string, schedule_id: string, data: {
277
- schedule: {
278
- name: string;
279
- description?: string;
280
- start_timestamp: string;
281
- end_timestamp: string;
282
- jump_channel_id: string;
283
- remind_type: number;
284
- };
285
- }): Promise<any>;
286
- channelsSchedulesScheduleDelete(channel_id: string, schedule_id: string): Promise<any>;
287
- channelsMessagesReactionsPut(channel_id: string, message_id: string, type: 1 | 2, id: string): Promise<any>;
288
- channelsMessagesReactionsDelete(channel_id: string, message_id: string, type: 1 | 2, id: string): Promise<any>;
289
- channelsMessagesReactionsUsers(channel_id: string, message_id: string, type: 1 | 2, id: string, data: {
290
- cookie?: string;
291
- limit?: number;
292
- }): Promise<any>;
293
- channelsAudioPost(channel_id: string, data: {
294
- audio_url?: string;
295
- text?: string;
296
- status: 0 | 1 | 2 | 3;
297
- }): Promise<any>;
298
- channelsMicPut(channel_id: string): Promise<any>;
299
- channelsMicDelete(channel_id: string): Promise<any>;
300
- channelsThreads(channel_id: string): Promise<any>;
301
- channelsThreadsThread(channel_id: string, thread_id: string): Promise<any>;
302
- channelsThreadsPut(channel_id: string, data: {
303
- title: string;
304
- content: string;
305
- format: 1 | 2 | 3 | 4;
306
- }): Promise<any>;
307
- channelsThreadsDelete(channel_id: string, thread_id: string): Promise<any>;
308
- guildApiPermission(guild_id: string): Promise<any>;
309
- interactionResponse(_mode: 'group' | 'guild', interaction_id: string, code?: number): Promise<any>;
772
+ }): Promise<any>;
773
+ /**
774
+ * 修改频道日程
775
+ * @param channel_id 子频道id
776
+ * @param schedule_id 日程id
777
+ * @param name 日程名称
778
+ * @param description 日程描述
779
+ * @param start_timestamp 日程开始时间戳
780
+ * @param end_timestamp 日程结束时间戳
781
+ * @param jump_channel_id 日程开始时跳转的子频道id
782
+ * @param remind_type 日程提醒类型
783
+ * 0不提醒
784
+ * 1开始时提醒
785
+ * 2开始前 5 分钟提醒
786
+ * 3开始前 15 分钟提醒
787
+ * 4开始前 30 分钟提醒
788
+ * 5开始前 60 分钟提醒
789
+ * @returns 返回 Schedule 对象(详见https://bot.q.qq.com/wiki/develop/api-v2/server-inter/channel/content/schedule/model.html#schedule)
790
+ */
791
+ channelsSchedulesSchedulePatch(channel_id: string, schedule_id: string, data: {
792
+ schedule: {
793
+ name: string;
794
+ description?: string;
795
+ start_timestamp: string;
796
+ end_timestamp: string;
797
+ jump_channel_id: string;
798
+ remind_type: number;
799
+ };
800
+ }): Promise<any>;
801
+ /**
802
+ * 删除频道日程
803
+ * @param channel_id 子频道id
804
+ * @param schedule_id 日程id
805
+ * @returns
806
+ */
807
+ channelsSchedulesScheduleDelete(channel_id: string, schedule_id: string): Promise<any>;
808
+ /**
809
+ * ***********
810
+ * 表情表态api
811
+ * ***********
812
+ */
813
+ /**
814
+ * 机器人发表表情表态
815
+ * @param channel_id 子频道id
816
+ * @param message_id 消息id
817
+ * @param type 表情类型 1:系统表情 2:emoji表情
818
+ * @param id 表情id 参考https://bot.q.qq.com/wiki/develop/api-v2/openapi/emoji/model.html#Emoji%20%E5%88%97%E8%A1%A8
819
+ * @returns
820
+ */
821
+ channelsMessagesReactionsPut(channel_id: string, message_id: string, type: 1 | 2, id: string): Promise<any>;
822
+ /**
823
+ * 删除机器人发表的表情表态
824
+ * @param channel_id 子频道id
825
+ * @param message_id 消息id
826
+ * @param type 表情类型 1:系统表情 2:emoji表情
827
+ * @param id 表情id 参考https://bot.q.qq.com/wiki/develop/api-v2/openapi/emoji/model.html#Emoji%20%E5%88%97%E8%A1%A8
828
+ * @returns
829
+ */
830
+ channelsMessagesReactionsDelete(channel_id: string, message_id: string, type: 1 | 2, id: string): Promise<any>;
831
+ /**
832
+ * 获取消息表情表态的用户列表
833
+ * @param channel_id 子频道id
834
+ * @param message_id 消息id
835
+ * @param type 表情类型 1:系统表情 2:emoji表情
836
+ * @param id 表情id 参考https://bot.q.qq.com/wiki/develop/api-v2/openapi/emoji/model.html#Emoji%20%E5%88%97%E8%A1%A8
837
+ * @param {object} data
838
+ * @param {object} data.cookie 返回的cookie 第一次请求不传,后续请求传上次返回的cookie
839
+ * @param {object} data.limit 返回的用户数量 默认20 最大50
840
+ * @returns data:{ users:User[], cookie:string,is_end:true|false }
841
+ */
842
+ channelsMessagesReactionsUsers(channel_id: string, message_id: string, type: 1 | 2, id: string, data: {
843
+ cookie?: string;
844
+ limit?: number;
845
+ }): Promise<any>;
846
+ /**
847
+ * ***********
848
+ * 音频api
849
+ * 音频接口:仅限音频类机器人才能使用,后续会根据机器人类型自动开通接口权限,现如需调用,需联系平台申请权限
850
+ * **********
851
+ */
852
+ /**
853
+ * 音频控制
854
+ * @param channel_id 子频道id
855
+ * @param audio_url 音频url status为0时传
856
+ * @param status 0:开始 1:暂停 2:继续 3:停止
857
+ * @param text 状态文本(比如:简单爱-周杰伦),可选,status为0时传,其他操作不传
858
+ * @returns
859
+ */
860
+ channelsAudioPost(channel_id: string, data: {
861
+ audio_url?: string;
862
+ text?: string;
863
+ status: 0 | 1 | 2 | 3;
864
+ }): Promise<any>;
865
+ /**
866
+ * 机器人上麦
867
+ * @param channel_id 语音子频道id
868
+ * @returns {}
869
+ */
870
+ channelsMicPut(channel_id: string): Promise<any>;
871
+ /**
872
+ * 机器人下麦
873
+ * @param channel_id 语音子频道id
874
+ * @returns {}
875
+ */
876
+ channelsMicDelete(channel_id: string): Promise<any>;
877
+ /**
878
+ * **********
879
+ * 帖子api
880
+ * 注意
881
+ * 公域机器人暂不支持申请,仅私域机器人可用,选择私域机器人后默认开通。
882
+ * 注意: 开通后需要先将机器人从频道移除,然后重新添加,方可生效。
883
+ * **********
884
+ */
885
+ /**
886
+ * 获取帖子列表
887
+ * @param channel_id 子频道id
888
+ * @returns {threads:Thread[],is_finish:0|1}
889
+ * @returns 返回 Thread 对象数组(详见https://bot.q.qq.com/wiki/develop/api-v2/server-inter/channel/content/forum/model.html#Thread)
890
+ * @returns is_finish 为 1 时,表示已拉取完 为 0 时,表示未拉取完
891
+ */
892
+ channelsThreads(channel_id: string): Promise<any>;
893
+ /**
894
+ * 获取帖子详情
895
+ * @param channel_id 子频道id
896
+ * @param thread_id 帖子id
897
+ * @returns 返回 帖子详情对象(详见https://bot.q.qq.com/wiki/develop/api-v2/server-inter/channel/content/forum/model.html#ThreadInfo)
898
+ * 其中content字段可参考 https://bot.q.qq.com/wiki/develop/api-v2/server-inter/channel/content/forum/model.html#RichText
899
+ */
900
+ channelsThreadsThread(channel_id: string, thread_id: string): Promise<any>;
901
+ /**
902
+ * 发表帖子
903
+ * @param channel_id 子频道id
904
+ * @param title 帖子标题
905
+ * @param content 帖子内容
906
+ * @param format 帖子内容格式 1:纯文本 2:HTML 3:Markdown 4:JSON
907
+ * @returns 返回 {task_id:string,create_time:string} 其中 task_id 为帖子id,create_time 发帖时间戳
908
+ */
909
+ channelsThreadsPut(channel_id: string, data: {
910
+ title: string;
911
+ content: string;
912
+ format: 1 | 2 | 3 | 4;
913
+ }): Promise<any>;
914
+ /**
915
+ * 删除帖子
916
+ * @param channel_id 子频道id
917
+ * @param thread_id 帖子id
918
+ * @returns
919
+ */
920
+ channelsThreadsDelete(channel_id: string, thread_id: string): Promise<any>;
921
+ /**
922
+ * ********
923
+ * 接口权限api
924
+ * **********
925
+ */
926
+ /**
927
+ * 获得频道可用权限列表
928
+ * @param guild_id
929
+ * @returns
930
+ */
931
+ guildApiPermission(guild_id: string): Promise<any>;
932
+ /**
933
+ * 交互事件回应
934
+ * @param interaction_id
935
+ * @param code
936
+ * @returns
937
+ */
938
+ interactionResponse(_mode: 'group' | 'guild', interaction_id: string, code?: number): Promise<any>;
310
939
  }
940
+ //#endregion
941
+ export { API_URL, API_URL_SANDBOX, BOTS_API_RUL, QQBotAPI, QQBotConnectionState, QQBotConnectionStatus, QQBotMediaHashes };