@alemonjs/qq-bot 0.0.19 → 0.0.21

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 (48) hide show
  1. package/README.md +6 -10
  2. package/lib/index.d.ts +2 -2
  3. package/lib/index.group.js +6 -203
  4. package/lib/index.guild.js +25 -298
  5. package/lib/index.js +42 -403
  6. package/lib/index.webhook.js +26 -0
  7. package/lib/register.d.ts +3 -0
  8. package/lib/register.js +405 -0
  9. package/lib/sdk/api.d.ts +5 -10
  10. package/lib/sdk/api.js +5 -10
  11. package/lib/sdk/client.websoket.js +221 -0
  12. package/lib/sdk/intents.js +12 -23
  13. package/lib/send/index.js +417 -366
  14. package/lib/sends.js +576 -0
  15. package/package.json +1 -1
  16. package/lib/api.d.ts +0 -975
  17. package/lib/api.js +0 -1188
  18. package/lib/client.d.ts +0 -26
  19. package/lib/client.js +0 -212
  20. package/lib/config.js +0 -3
  21. package/lib/from.js +0 -37
  22. package/lib/message/AT_MESSAGE_CREATE.d.ts +0 -37
  23. package/lib/message/C2C_MESSAGE_CREATE.d.ts +0 -11
  24. package/lib/message/CHANNEL_CREATE.d.ts +0 -17
  25. package/lib/message/CHANNEL_DELETE.d.ts +0 -22
  26. package/lib/message/CHANNEL_UPDATE.d.ts +0 -22
  27. package/lib/message/DIRECT_MESSAGE_CREATE.d.ts +0 -36
  28. package/lib/message/DIRECT_MESSAGE_DELETE.d.ts +0 -24
  29. package/lib/message/ERROR.d.ts +0 -3
  30. package/lib/message/GROUP_AT_MESSAGE_CREATE.d.ts +0 -16
  31. package/lib/message/GUILD_CREATE.d.ts +0 -22
  32. package/lib/message/GUILD_DELETE.d.ts +0 -22
  33. package/lib/message/GUILD_MEMBER_ADD.d.ts +0 -21
  34. package/lib/message/GUILD_MEMBER_REMOVE.d.ts +0 -21
  35. package/lib/message/GUILD_MEMBER_UPDATE.d.ts +0 -21
  36. package/lib/message/GUILD_UPDATE.d.ts +0 -22
  37. package/lib/message/INTERACTION_CREATE.d.ts +0 -8
  38. package/lib/message/MESSAGE_CREATE.d.ts +0 -11
  39. package/lib/message/MESSAGE_DELETE.d.ts +0 -11
  40. package/lib/message/MESSAGE_REACTION_ADD.d.ts +0 -15
  41. package/lib/message/MESSAGE_REACTION_REMOVE.d.ts +0 -15
  42. package/lib/message/PUBLIC_MESSAGE_DELETE.d.ts +0 -21
  43. package/lib/message/READY.d.ts +0 -11
  44. package/lib/message.d.ts +0 -49
  45. package/lib/typing.d.ts +0 -73
  46. package/lib/webhook.js +0 -51
  47. /package/lib/sdk/{websoket.group.js → client.websoket.group.js} +0 -0
  48. /package/lib/sdk/{websoket.guild.js → client.websoket.guild.js} +0 -0
package/lib/api.d.ts DELETED
@@ -1,975 +0,0 @@
1
- import * as axios from 'axios'
2
- import { AxiosRequestConfig } from 'axios'
3
- import { ApiRequestData, FileType } from './typing.js'
4
- import FormData from 'form-data'
5
-
6
- declare class QQBotAPI {
7
- #private
8
- /**
9
- * qq机器人
10
- */
11
- BOTS_API_RUL: string
12
- /**
13
- * qq群 沙河接口
14
- */
15
- API_URL_SANDBOX: string
16
- /**
17
- * qq群
18
- */
19
- API_URL: string
20
- /**
21
- * 得到鉴权
22
- * @param appId
23
- * @param clientSecret
24
- * @param url
25
- * @returns
26
- */
27
- getAuthentication(app_id: string, clientSecret: string): Promise<axios.AxiosResponse<any, any>>
28
- /**
29
- * group
30
- * @param config
31
- * @returns
32
- */
33
- groupService(options: AxiosRequestConfig): Promise<axios.AxiosResponse<any, any>>
34
- /**
35
- * guild
36
- * @param opstion
37
- * @returns
38
- */
39
- guildServer(opstion: AxiosRequestConfig): Promise<axios.AxiosResponse<any, any>>
40
- /**
41
- * 得到鉴权
42
- * @returns
43
- */
44
- gateway(): Promise<any>
45
- /**
46
- * 发送私聊消息
47
- * @param openid
48
- * @param content
49
- * @param msg_id
50
- * @returns
51
- * 0 文本 1 图文 2 md 3 ark 4 embed
52
- */
53
- usersOpenMessages(
54
- openid: string,
55
- data: ApiRequestData,
56
- _msg_id?: string
57
- ): Promise<{
58
- id: string
59
- timestamp: number
60
- }>
61
- /**
62
- * 得到消息序列
63
- * @param MessageId
64
- * @returns
65
- */
66
- getMessageSeq(MessageId: string): number
67
- /**
68
- * 发送群聊消息
69
- * @param group_openid
70
- * @param content
71
- * @param msg_id
72
- * @returns
73
- */
74
- groupOpenMessages(
75
- group_openid: string,
76
- data: ApiRequestData
77
- ): Promise<{
78
- id: string
79
- timestamp: number
80
- }>
81
- /**
82
- * 发送私聊富媒体文件
83
- * @param openid
84
- * @param content
85
- * @param file_type
86
- * @returns
87
- * 1 图文 2 视频 3 语言 4 文件
88
- * 图片:png/jpg,视频:mp4,语音:silk
89
- */
90
- postRichMediaByUsers(
91
- openid: string,
92
- data: {
93
- srv_send_msg?: boolean
94
- file_type: FileType
95
- url?: string
96
- file_data?: any
97
- }
98
- ): Promise<{
99
- file_uuid: string
100
- file_info: string
101
- ttl: number
102
- }>
103
- /**
104
- * 发送私聊富媒体文件
105
- * @param openid
106
- * @param content
107
- * @param file_type
108
- * @returns
109
- * 1 图文 2 视频 3 语言 4 文件
110
- * 图片:png/jpg,视频:mp4,语音:silk
111
- */
112
- userFiles(
113
- openid: string,
114
- data: {
115
- srv_send_msg: boolean
116
- file_type: FileType
117
- url: string
118
- file_data?: any
119
- }
120
- ): Promise<{
121
- file_uuid: string
122
- file_info: string
123
- ttl: number
124
- }>
125
- /**
126
- * 发送群里文件
127
- * @param openid
128
- * @param content
129
- * @param file_type
130
- * @returns
131
- * 1 图文 2 视频 3 语言 4 文件
132
- * 图片:png/jpg,视频:mp4,语音:silk
133
- */
134
- postRichMediaByGroup(
135
- openid: string,
136
- data: {
137
- srv_send_msg?: boolean
138
- file_type: FileType
139
- url?: string
140
- file_data?: any
141
- }
142
- ): Promise<{
143
- file_uuid: string
144
- file_info: string
145
- ttl: number
146
- }>
147
- /**
148
- *
149
- * @param openid
150
- * @param data
151
- * @returns
152
- */
153
- groupsFiles(
154
- openid: string,
155
- data: {
156
- srv_send_msg?: boolean
157
- file_type: FileType
158
- url?: string
159
- file_data?: any
160
- }
161
- ): Promise<{
162
- file_uuid: string
163
- file_info: string
164
- ttl: number
165
- }>
166
- /**
167
- * 创建模板
168
- * *********
169
- * 使用该方法,你需要申请模板Id
170
- * 并设置markdown源码为{{.text_0}}{{.text_1}}
171
- * {{.text_2}}{{.text_3}}{{.text_4}}{{.text_5}}
172
- * {{.text_6}}{{.text_7}}{{.text_8}}{{.text_9}}
173
- * 当前,你也可以传递回调对key和values进行休整
174
- * @param custom_template_id
175
- * @param mac 默认 9
176
- * @param callBack 默认 (key,values)=>({key,values})
177
- * @returns
178
- */
179
- createTemplate(
180
- custom_template_id: string,
181
- mac?: number,
182
- callBack?: (
183
- key: string,
184
- values: string[]
185
- ) => {
186
- key: string
187
- values: string[]
188
- }
189
- ): {
190
- size: number
191
- text: (value: string, change?: boolean) => void
192
- prefix: (start: string, label: string) => void
193
- suffix: ({
194
- value,
195
- enter,
196
- reply,
197
- change,
198
- end
199
- }: {
200
- value: any
201
- enter?: boolean
202
- reply?: boolean
203
- change?: boolean
204
- end?: string
205
- }) => void
206
- button: ({
207
- label,
208
- value,
209
- start,
210
- end,
211
- enter,
212
- reply,
213
- change
214
- }: {
215
- label: any
216
- value: any
217
- start?: string
218
- end?: string
219
- enter?: boolean
220
- reply?: boolean
221
- change?: boolean
222
- }) => void
223
- code: (val: string) => void
224
- getParam: () => {
225
- msg_type: number
226
- markdown: {
227
- custom_template_id: string
228
- params: {
229
- key: string
230
- values: string[]
231
- }[]
232
- }
233
- }
234
- }
235
- /**
236
- *
237
- * @param openid
238
- * @param message_id
239
- * @returns
240
- */
241
- userMessageDelete(openid: string, message_id: string): Promise<any>
242
- /**
243
- *
244
- * @param group_openid
245
- * @param message_id
246
- * @returns
247
- */
248
- grouMessageDelte(group_openid: string, message_id: string): Promise<any>
249
- /**
250
- * 创建form
251
- * @param image
252
- * @param msg_id
253
- * @param content
254
- * @param name
255
- * @returns
256
- */
257
- createFrom(image: Buffer, msg_id: string, content: any, Name?: string): Promise<false | FormData>
258
- /**
259
- * ************
260
- * 消息-图片接口
261
- * ***********
262
- */
263
- /**
264
- * 发送buffer图片
265
- * @param id 私信传频道id,公信传子频道id
266
- * @param message {消息编号,图片,内容}
267
- * @param isGroup 是否是群聊
268
- * @returns
269
- */
270
- postImage(
271
- channel_id: string,
272
- message: {
273
- msg_id: string
274
- image: Buffer
275
- content?: string
276
- name?: string
277
- }
278
- ): Promise<any>
279
- /**
280
- * 私聊发送buffer图片
281
- * @param id 私信传频道id,公信传子频道id
282
- * @param message {消息编号,图片,内容}
283
- * @returns
284
- */
285
- postDirectImage(
286
- guild_id: string,
287
- message: {
288
- msg_id: string
289
- image: Buffer
290
- content?: string
291
- name?: string
292
- }
293
- ): Promise<any>
294
- /**
295
- * ********
296
- * 用户api
297
- * *******
298
- */
299
- /**
300
- * 获取用户详情
301
- * @param message
302
- * @returns
303
- */
304
- usersMe(): Promise<any>
305
- /**
306
- * 获取用户频道列表
307
- * @param message
308
- * @returns
309
- */
310
- usersMeGuilds(params: { before: string; after: string; limit: number }): Promise<any>
311
- /**
312
- * **********
313
- * 频道api
314
- * **********
315
- */
316
- /**
317
- * 获取频道详细
318
- * @param guild_id
319
- * @returns
320
- */
321
- guilds(guild_id: string): Promise<any>
322
- /**
323
- * ************
324
- * 子频道api
325
- * ***********
326
- */
327
- /**
328
- * 获取子频道列表
329
- * @param guild_id
330
- * @returns
331
- */
332
- guildsChannels(guild_id: string): Promise<any>
333
- /**
334
- * 获取子频道详情
335
- * @param channel_id
336
- * @returns
337
- */
338
- channels(channel_id: string): Promise<any>
339
- /**
340
- * 创建子频道
341
- * @param guild_id
342
- * @returns
343
- */
344
- guildsChannelsCreate(
345
- guild_id: string,
346
- data: {
347
- name: string
348
- type: number
349
- sub_type: number
350
- position: number
351
- parent_id: string
352
- private_type: number
353
- private_user_ids: string[]
354
- speak_permission: number
355
- application_id: string
356
- }
357
- ): Promise<any>
358
- /**
359
- * 创建子频道
360
- * @param channel_id
361
- * @returns
362
- */
363
- guildsChannelsUpdate(
364
- channel_id: string,
365
- data: {
366
- name: string
367
- position: number
368
- parent_id: string
369
- private_type: number
370
- speak_permission: number
371
- }
372
- ): Promise<any>
373
- /**
374
- * 删除子频道
375
- * @param channel_id
376
- * @param data
377
- * @returns
378
- */
379
- guildsChannelsdelete(
380
- channel_id: string,
381
- data: {
382
- name: string
383
- position: number
384
- parent_id: string
385
- private_type: number
386
- speak_permission: number
387
- }
388
- ): Promise<any>
389
- /**
390
- * 获取在线成员数
391
- * @param channel_id
392
- * @returns
393
- */
394
- channelsChannelOnlineNums(channel_id: string): Promise<any>
395
- /**
396
- * *********
397
- * 成员api
398
- * *********
399
- */
400
- /**
401
- * 获取频道成员列表
402
- * @param guild_id
403
- * @returns
404
- */
405
- guildsMembers(
406
- guild_id: string,
407
- params: {
408
- after: string
409
- limit: number
410
- }
411
- ): Promise<any>
412
- /**
413
- * 获取频道身份组成员列表
414
- * @param guild_id
415
- * @param role_id
416
- * @param params
417
- * @returns
418
- */
419
- guildsRolesMembers(
420
- guild_id: string,
421
- role_id: string,
422
- params: {
423
- start_index: string
424
- limit: number
425
- }
426
- ): Promise<any>
427
- /**
428
- * 获取成员详情
429
- * @param guild_id
430
- * @param user_id
431
- * @returns
432
- */
433
- guildsMembersMessage(guild_id: string, user_id: string): Promise<any>
434
- /**
435
- * 删除频道成员
436
- * @param guild_id
437
- * @param user_id
438
- * @returns
439
- */
440
- guildsMembersDelete(guild_id: string, user_id: string): Promise<any>
441
- /**
442
- * 获取指定消息
443
- * @param channel_id
444
- * @param message_id
445
- * @returns
446
- */
447
- channelsMessages(channel_id: string, message_id: string): Promise<any>
448
- /**
449
- * 发送消息
450
- * @param channel_id
451
- * @param message_id
452
- * @param data
453
- * @returns
454
- */
455
- channelsMessagesPost(
456
- channel_id: string,
457
- data: {
458
- content?: string
459
- embed?: any
460
- ark?: any
461
- message_reference?: any
462
- image?: string
463
- msg_id?: string
464
- event_id?: string
465
- markdown?: any
466
- }
467
- ): Promise<any>
468
- /**
469
- * 撤回消息
470
- * @param channel_id
471
- * @param message_id
472
- * @param hidetip
473
- * @returns
474
- */
475
- channelsMessagesDelete(channel_id: string, message_id: string, hidetip?: boolean): Promise<any>
476
- /**
477
- * ***********
478
- * 频道身份api
479
- * ***********
480
- */
481
- /**
482
- * 获取频道身份组列表
483
- * @param guild_id 频道id
484
- * @returns
485
- */
486
- guildsRoles(guild_id: string): Promise<any>
487
- /**
488
- * 创建频道身份组
489
- * @param guild_id 频道id
490
- * @param {object} data 参数
491
- * @param {object?} data.name 身份组名称
492
- * @param {object?} data.color ARGB 的 HEX 十六进制颜色值转换后的十进制数值
493
- * @param {object?} data.hoist 在成员列表中单独展示: 0-否, 1-是
494
- * @returns
495
- */
496
- guildsRolesPost(
497
- guild_id: string,
498
- data: {
499
- name?: string
500
- color?: number
501
- hoist?: 0 | 1
502
- }
503
- ): Promise<any>
504
- /**
505
- * 修改频道身份组
506
- * @param guild_id 频道id
507
- * @param {object} data 参数
508
- * @param {object?} data.name 身份组名称
509
- * @param {object?} data.color ARGB 的 HEX 十六进制颜色值转换后的十进制数值
510
- * @param {object?} data.hoist 在成员列表中单独展示: 0-否, 1-是
511
- * @returns
512
- */
513
- guildsRolesPatch(
514
- guild_id: string,
515
- role_id: string,
516
- data: {
517
- name?: string
518
- color?: number
519
- hoist?: 0 | 1
520
- }
521
- ): Promise<any>
522
- /**
523
- * 删除频道身份组
524
- * @param guild_id 频道id
525
- * @param role_id 身份组id
526
- */
527
- guildsRolesDelete(guild_id: string, role_id: string): Promise<any>
528
- /**
529
- * 将成员添加到频道身份组
530
- * @param guild_id 频道id
531
- * @param channel_id 子频道id
532
- * @param user_id 用户id
533
- * @param role_id 身份组id
534
- * @returns
535
- */
536
- guildsRolesMembersPut(
537
- guild_id: string,
538
- channel_id: string,
539
- user_id: string,
540
- role_id: string
541
- ): Promise<any>
542
- /**
543
- * 将成员从频道身份组移除
544
- * @param guild_id 频道id
545
- * @param channel_id 子频道id
546
- * @param user_id 用户id
547
- * @param role_id 身份组id
548
- * @returns
549
- */
550
- guildsRolesMembersDelete(
551
- guild_id: string,
552
- channel_id: string,
553
- user_id: string,
554
- role_id: string
555
- ): Promise<any>
556
- /**
557
- * **********
558
- * 子频道权限api
559
- * **********
560
- */
561
- /**
562
- * 获取子频道用户权限
563
- * @param channel_id 子频道id
564
- * @param user_id 用户id
565
- */
566
- channelsPermissions(channel_id: string, user_id: string): Promise<any>
567
- /**
568
- * 修改子频道用户权限
569
- * @param channel_id 子频道id
570
- * @param user_id 用户id
571
- * @param 参数包括add和remove两个字段分别表示授予的权限以及删除的权限。要授予用户权限即把add对应位置 1,删除用户权限即把remove对应位置 1。当两个字段同一位都为 1,表现为删除权限。
572
- */
573
- channelsPermissionsPut(
574
- channel_id: string,
575
- user_id: string,
576
- add: string,
577
- remove: string
578
- ): Promise<any>
579
- /**
580
- * *******
581
- * 消息api
582
- * ********
583
- */
584
- /**
585
- * ************
586
- * 消息频率api
587
- * **********
588
- */
589
- /**
590
- * 查询频道消息频率限制
591
- * @param guild_id 频道id
592
- * @returns
593
- */
594
- guildsMessageSetting(guild_id: string): Promise<any>
595
- /**
596
- * ***********
597
- * 私信api
598
- * **********
599
- */
600
- /**
601
- * 创建私信会话
602
- * @param recipient_id 接收者 id
603
- * @param source_guild_id 源频道 id
604
- * @returns
605
- */
606
- usersMeDms(): Promise<any>
607
- /**
608
- * 发送私信
609
- * @param guild_id
610
- * @returns
611
- */
612
- dmsMessage(
613
- guild_id: string,
614
- data: {
615
- content?: string
616
- embed?: any
617
- ark?: any
618
- message_reference?: any
619
- image?: string
620
- msg_id?: string
621
- event_id?: string
622
- markdown?: any
623
- }
624
- ): Promise<any>
625
- /**
626
- * 撤回私信
627
- * @param guild_id
628
- * @param data
629
- * @returns
630
- */
631
- dmsMessageDelete(guild_id: string, message_id: string, hidetip?: boolean): Promise<any>
632
- /**
633
- * *********
634
- * 禁言api
635
- * *******
636
- */
637
- /**
638
- * 全体禁言(非管理员)
639
- * @param guild_id 频道id
640
- * @param data { mute_end_timestamp:禁言结束时间戳, mute_seconds:禁言时长 } 两个参数必须传一个 优先级 mute_end_timestamp > mute_seconds
641
- * 将mute_end_timestamp或mute_seconds传值为字符串'0',则表示解除全体禁言
642
- */
643
- guildsMuteAll(
644
- guild_id: string,
645
- data: {
646
- mute_end_timestamp?: string
647
- mute_seconds?: string
648
- }
649
- ): Promise<any>
650
- /**
651
- * 频道指定成员禁言
652
- * @param guild_id 频道id
653
- * @param user_id 用户id
654
- * @param data { mute_end_timestamp:禁言结束时间戳, mute_seconds:禁言时长 } 两个参数必须传一个 优先级 mute_end_timestamp > mute_seconds
655
- * 将mute_end_timestamp或mute_seconds传值为字符串'0',则表示解除禁言
656
- * @returns
657
- */
658
- guildsMemberMute(
659
- guild_id: string,
660
- user_id: string,
661
- data: {
662
- mute_end_timestamp?: string
663
- mute_seconds?: string
664
- }
665
- ): Promise<any>
666
- /**
667
- * 频道批量禁言
668
- * @param guild_id 频道id
669
- * @param data { mute_end_timestamp:禁言结束时间戳, mute_seconds:禁言时长, user_ids:用户id数组 } 两个参数必须传一个 优先级 mute_end_timestamp > mute_seconds
670
- * 将mute_end_timestamp或mute_seconds传值为字符串'0',则表示解除禁言
671
- */
672
- guildsMute(
673
- guild_id: string,
674
- data: {
675
- mute_end_timestamp?: string
676
- mute_seconds?: string
677
- user_ids: string[]
678
- }
679
- ): Promise<any>
680
- /**
681
- * *******
682
- * 公告api
683
- * *******
684
- */
685
- /**
686
- * 创建频道公告
687
- * 公告类型分为 消息类型的频道公告 和 推荐子频道类型的频道公告
688
- * 详见 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
689
- * @param guild_id 频道id
690
- * @param data { message_id:消息id, channel_id:频道id, announces_type:公告类型, recommend_channels:推荐频道id数组 }
691
- * @param channel_id 子频道id 消息id存在时必须传
692
- * @param announces_type 0:成员公告 1:欢迎公告 默认为 0
693
- * @param recommend_channels 推荐频道id数组 "recommend_channels": [{ "channel_id": "xxxx","introduce": "推荐语" }]
694
- * @returns 返回Announces 对象 (https://bot.q.qq.com/wiki/develop/api-v2/server-inter/channel/content/announces/model.html#Announces)
695
- */
696
- guildsAnnounces(
697
- guild_id: string,
698
- data: {
699
- message_id?: string
700
- channel_id?: string
701
- announces_type?: 0 | 1
702
- recommend_channels?: string[]
703
- }
704
- ): Promise<any>
705
- /**
706
- * 删除频道公告
707
- * @param guild_id 频道id
708
- * @param message_id 消息id message_id 有值时,会校验 message_id 合法性,若不校验校验 message_id,请将 message_id 设置为 all
709
- * @returns
710
- */
711
- guildsAnnouncesDelete(guild_id: string, message_id: string): Promise<any>
712
- /**
713
- * **********
714
- * 精华消息api
715
- * **********
716
- */
717
- /**
718
- * 添加精华消息
719
- * @param channel_id 频道id
720
- * @param message_id 消息id
721
- * @returns 返回 PinsMessage对象 { "guild_id": "xxxxxx", "channel_id": "xxxxxx", "message_ids": ["xxxxx"]}
722
- * @returns message_ids 为当前请求后子频道内所有精华消息 message_id 数组
723
- */
724
- channelsPinsPut(channel_id: string, message_id: string): Promise<any>
725
- /**
726
- * 删除精华消息
727
- * @param channel_id 子频道id
728
- * @param message_id 消息id
729
- * 删除子频道内全部精华消息,请将 message_id 设置为 all
730
- * @returns
731
- */
732
- channelsPinsDelete(channel_id: string, message_id: string): Promise<any>
733
- /**
734
- * 获取精华消息
735
- * @param channel_id 子频道id
736
- * @returns 返回 PinsMessage对象 { "guild_id": "xxxxxx", "channel_id": "xxxxxx", "message_ids": ["xxxxx"]}
737
- * @returns message_ids 为当前请求后子频道内所有精华消息 message_id 数组
738
- */
739
- channelsPins(channel_id: string): Promise<any>
740
- /**
741
- * ********
742
- * 日程api
743
- * *******
744
- */
745
- /**
746
- * 获取频道日程列表
747
- * @param channel_id 子频道id
748
- * @returns 返回 Schedule 对象数组(详见https://bot.q.qq.com/wiki/develop/api-v2/server-inter/channel/content/schedule/model.html#schedule)
749
- */
750
- channelsSchedules(channel_id: string): Promise<any>
751
- /**
752
- * 获取频道日程详情
753
- * @param channel_id 子频道id
754
- * @param schedule_id 日程id
755
- * @returns 返回 Schedule 对象(详见https://bot.q.qq.com/wiki/develop/api-v2/server-inter/channel/content/schedule/model.html#schedule)
756
- */
757
- channelsSchedulesSchedule(channel_id: string, schedule_id: string): Promise<any>
758
- /**
759
- * 创建频道日程
760
- * @param channel_id 子频道id
761
- * @param name 日程名称
762
- * @param description 日程描述
763
- * @param start_timestamp 日程开始时间戳
764
- * @param end_timestamp 日程结束时间戳
765
- * @param jump_channel_id 日程开始时跳转的子频道id
766
- * @param remind_type 日程提醒类型
767
- * 0 不提醒
768
- * 1 开始时提醒
769
- * 2 开始前 5 分钟提醒
770
- * 3 开始前 15 分钟提醒
771
- * 4 开始前 30 分钟提醒
772
- * 5 开始前 60 分钟提醒
773
- * @returns 返回 Schedule 对象(详见https://bot.q.qq.com/wiki/develop/api-v2/server-inter/channel/content/schedule/model.html#schedule)
774
- */
775
- channelsSchedulesPost(
776
- channel_id: string,
777
- data: {
778
- schedule: {
779
- name: string
780
- description?: string
781
- start_timestamp: string
782
- end_timestamp: string
783
- jump_channel_id: string
784
- remind_type: number
785
- }
786
- }
787
- ): Promise<any>
788
- /**
789
- * 修改频道日程
790
- * @param channel_id 子频道id
791
- * @param schedule_id 日程id
792
- * @param name 日程名称
793
- * @param description 日程描述
794
- * @param start_timestamp 日程开始时间戳
795
- * @param end_timestamp 日程结束时间戳
796
- * @param jump_channel_id 日程开始时跳转的子频道id
797
- * @param remind_type 日程提醒类型
798
- * 0 不提醒
799
- * 1 开始时提醒
800
- * 2 开始前 5 分钟提醒
801
- * 3 开始前 15 分钟提醒
802
- * 4 开始前 30 分钟提醒
803
- * 5 开始前 60 分钟提醒
804
- * @returns 返回 Schedule 对象(详见https://bot.q.qq.com/wiki/develop/api-v2/server-inter/channel/content/schedule/model.html#schedule)
805
- */
806
- channelsSchedulesSchedulePatch(
807
- channel_id: string,
808
- schedule_id: string,
809
- data: {
810
- schedule: {
811
- name: string
812
- description?: string
813
- start_timestamp: string
814
- end_timestamp: string
815
- jump_channel_id: string
816
- remind_type: number
817
- }
818
- }
819
- ): Promise<any>
820
- /**
821
- * 删除频道日程
822
- * @param channel_id 子频道id
823
- * @param schedule_id 日程id
824
- * @returns
825
- */
826
- channelsSchedulesScheduleDelete(channel_id: string, schedule_id: string): Promise<any>
827
- /**
828
- * ***********
829
- * 表情表态api
830
- * ***********
831
- */
832
- /**
833
- * 机器人发表表情表态
834
- * @param channel_id 子频道id
835
- * @param message_id 消息id
836
- * @param type 表情类型 1:系统表情 2:emoji表情
837
- * @param id 表情id 参考https://bot.q.qq.com/wiki/develop/api-v2/openapi/emoji/model.html#Emoji%20%E5%88%97%E8%A1%A8
838
- * @returns
839
- */
840
- channelsMessagesReactionsPut(
841
- channel_id: string,
842
- message_id: string,
843
- type: 1 | 2,
844
- id: string
845
- ): Promise<any>
846
- /**
847
- * 删除机器人发表的表情表态
848
- * @param channel_id 子频道id
849
- * @param message_id 消息id
850
- * @param type 表情类型 1:系统表情 2:emoji表情
851
- * @param id 表情id 参考https://bot.q.qq.com/wiki/develop/api-v2/openapi/emoji/model.html#Emoji%20%E5%88%97%E8%A1%A8
852
- * @returns
853
- */
854
- channelsMessagesReactionsDelete(
855
- channel_id: string,
856
- message_id: string,
857
- type: 1 | 2,
858
- id: string
859
- ): Promise<any>
860
- /**
861
- * 获取消息表情表态的用户列表
862
- * @param channel_id 子频道id
863
- * @param message_id 消息id
864
- * @param type 表情类型 1:系统表情 2:emoji表情
865
- * @param id 表情id 参考https://bot.q.qq.com/wiki/develop/api-v2/openapi/emoji/model.html#Emoji%20%E5%88%97%E8%A1%A8
866
- * @param {object} data
867
- * @param {object} data.cookie 返回的cookie 第一次请求不传,后续请求传上次返回的cookie
868
- * @param {object} data.limit 返回的用户数量 默认20 最大50
869
- * @returns data:{ users:User[], cookie:string,is_end:true|false }
870
- */
871
- channelsMessagesReactionsUsers(
872
- channel_id: string,
873
- message_id: string,
874
- type: 1 | 2,
875
- id: string,
876
- data: {
877
- cookie?: string
878
- limit?: number
879
- }
880
- ): Promise<any>
881
- /**
882
- * ***********
883
- * 音频api
884
- * 音频接口:仅限音频类机器人才能使用,后续会根据机器人类型自动开通接口权限,现如需调用,需联系平台申请权限
885
- * **********
886
- */
887
- /**
888
- * 音频控制
889
- * @param channel_id 子频道id
890
- * @param audio_url 音频url status为0时传
891
- * @param status 0:开始 1:暂停 2:继续 3:停止
892
- * @param text 状态文本(比如:简单爱-周杰伦),可选,status为0时传,其他操作不传
893
- * @returns
894
- */
895
- channelsAudioPost(
896
- channel_id: string,
897
- data: {
898
- audio_url?: string
899
- text?: string
900
- status: 0 | 1 | 2 | 3
901
- }
902
- ): Promise<any>
903
- /**
904
- * 机器人上麦
905
- * @param channel_id 语音子频道id
906
- * @returns {}
907
- */
908
- channelsMicPut(channel_id: string): Promise<any>
909
- /**
910
- * 机器人下麦
911
- * @param channel_id 语音子频道id
912
- * @returns {}
913
- */
914
- channelsMicDelete(channel_id: string): Promise<any>
915
- /**
916
- * **********
917
- * 帖子api
918
- * 注意
919
- * 公域机器人暂不支持申请,仅私域机器人可用,选择私域机器人后默认开通。
920
- * 注意: 开通后需要先将机器人从频道移除,然后重新添加,方可生效。
921
- * **********
922
- */
923
- /**
924
- * 获取帖子列表
925
- * @param channel_id 子频道id
926
- * @returns {threads:Thread[],is_finish:0|1}
927
- * @returns 返回 Thread 对象数组(详见https://bot.q.qq.com/wiki/develop/api-v2/server-inter/channel/content/forum/model.html#Thread)
928
- * @returns is_finish 为 1 时,表示已拉取完 为 0 时,表示未拉取完
929
- */
930
- channelsThreads(channel_id: string): Promise<any>
931
- /**
932
- * 获取帖子详情
933
- * @param channel_id 子频道id
934
- * @param thread_id 帖子id
935
- * @returns 返回 帖子详情对象(详见https://bot.q.qq.com/wiki/develop/api-v2/server-inter/channel/content/forum/model.html#ThreadInfo)
936
- * 其中content字段可参考 https://bot.q.qq.com/wiki/develop/api-v2/server-inter/channel/content/forum/model.html#RichText
937
- */
938
- channelsThreadsThread(channel_id: string, thread_id: string): Promise<any>
939
- /**
940
- * 发表帖子
941
- * @param channel_id 子频道id
942
- * @param title 帖子标题
943
- * @param content 帖子内容
944
- * @param format 帖子内容格式 1:纯文本 2:HTML 3:Markdown 4:JSON
945
- * @returns 返回 {task_id:string,create_time:string} 其中 task_id 为帖子id,create_time 发帖时间戳
946
- */
947
- channelsThreadsPut(
948
- channel_id: string,
949
- data: {
950
- title: string
951
- content: string
952
- format: 1 | 2 | 3 | 4
953
- }
954
- ): Promise<any>
955
- /**
956
- * 删除帖子
957
- * @param channel_id 子频道id
958
- * @param thread_id 帖子id
959
- * @returns
960
- */
961
- channelsThreadsDelete(channel_id: string, thread_id: string): Promise<any>
962
- /**
963
- * ********
964
- * 接口权限api
965
- * **********
966
- */
967
- /**
968
- * 获得频道可用权限列表
969
- * @param guild_id
970
- * @returns
971
- */
972
- guildApiPermission(guild_id: string): Promise<any>
973
- }
974
-
975
- export { QQBotAPI }