@im-more/dsh-kook 0.0.0-stage → 0.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.
Files changed (76) hide show
  1. package/LICENSE +21 -0
  2. package/cordis.patch.yml +12 -0
  3. package/lib/index.js +2380 -0
  4. package/lib/index.js.map +1 -0
  5. package/lib/types/bot.d.ts +53 -0
  6. package/lib/types/bot.d.ts.map +1 -0
  7. package/lib/types/bot.js +138 -0
  8. package/lib/types/bot.js.map +1 -0
  9. package/lib/types/config.d.ts +46 -0
  10. package/lib/types/config.d.ts.map +1 -0
  11. package/lib/types/config.js +52 -0
  12. package/lib/types/config.js.map +1 -0
  13. package/lib/types/decode.d.ts +88 -0
  14. package/lib/types/decode.d.ts.map +1 -0
  15. package/lib/types/decode.js +564 -0
  16. package/lib/types/decode.js.map +1 -0
  17. package/lib/types/errors.d.ts +46 -0
  18. package/lib/types/errors.d.ts.map +1 -0
  19. package/lib/types/errors.js +159 -0
  20. package/lib/types/errors.js.map +1 -0
  21. package/lib/types/identity.d.ts +17 -0
  22. package/lib/types/identity.d.ts.map +1 -0
  23. package/lib/types/identity.js +24 -0
  24. package/lib/types/identity.js.map +1 -0
  25. package/lib/types/index.d.ts +15 -0
  26. package/lib/types/index.d.ts.map +1 -0
  27. package/lib/types/index.js +15 -0
  28. package/lib/types/index.js.map +1 -0
  29. package/lib/types/kmarkdown.d.ts +76 -0
  30. package/lib/types/kmarkdown.d.ts.map +1 -0
  31. package/lib/types/kmarkdown.js +201 -0
  32. package/lib/types/kmarkdown.js.map +1 -0
  33. package/lib/types/modes/kmarkdown.d.ts +17 -0
  34. package/lib/types/modes/kmarkdown.d.ts.map +1 -0
  35. package/lib/types/modes/kmarkdown.js +166 -0
  36. package/lib/types/modes/kmarkdown.js.map +1 -0
  37. package/lib/types/modes/shared.d.ts +192 -0
  38. package/lib/types/modes/shared.d.ts.map +1 -0
  39. package/lib/types/modes/shared.js +371 -0
  40. package/lib/types/modes/shared.js.map +1 -0
  41. package/lib/types/request.d.ts +53 -0
  42. package/lib/types/request.d.ts.map +1 -0
  43. package/lib/types/request.js +147 -0
  44. package/lib/types/request.js.map +1 -0
  45. package/lib/types/send.d.ts +57 -0
  46. package/lib/types/send.d.ts.map +1 -0
  47. package/lib/types/send.js +141 -0
  48. package/lib/types/send.js.map +1 -0
  49. package/lib/types/types.d.ts +807 -0
  50. package/lib/types/types.d.ts.map +1 -0
  51. package/lib/types/types.js +168 -0
  52. package/lib/types/types.js.map +1 -0
  53. package/lib/types/webhook.d.ts +35 -0
  54. package/lib/types/webhook.d.ts.map +1 -0
  55. package/lib/types/webhook.js +132 -0
  56. package/lib/types/webhook.js.map +1 -0
  57. package/lib/types/ws.d.ts +54 -0
  58. package/lib/types/ws.d.ts.map +1 -0
  59. package/lib/types/ws.js +358 -0
  60. package/lib/types/ws.js.map +1 -0
  61. package/package.json +61 -3
  62. package/src/bot.ts +217 -0
  63. package/src/config.ts +84 -0
  64. package/src/decode.ts +660 -0
  65. package/src/errors.ts +188 -0
  66. package/src/identity.ts +32 -0
  67. package/src/index.ts +80 -0
  68. package/src/kmarkdown.ts +246 -0
  69. package/src/modes/kmarkdown.ts +204 -0
  70. package/src/modes/shared.ts +498 -0
  71. package/src/request.ts +196 -0
  72. package/src/send.ts +216 -0
  73. package/src/types.ts +764 -0
  74. package/src/webhook.ts +170 -0
  75. package/src/ws.ts +431 -0
  76. package/README.md +0 -3
@@ -0,0 +1,807 @@
1
+ import type { KookBot } from './bot.ts';
2
+ import { type KookRequest } from './request.ts';
3
+ export declare enum Signal {
4
+ event = 0,
5
+ hello = 1,
6
+ ping = 2,
7
+ pong = 3,
8
+ reconnect = 4,
9
+ resume = 5
10
+ }
11
+ export interface Payload {
12
+ s: Signal;
13
+ sn?: number;
14
+ d: Data;
15
+ }
16
+ export declare enum Type {
17
+ text = 1,
18
+ image = 2,
19
+ video = 3,
20
+ file = 4,
21
+ unknown = 7,
22
+ audio = 8,
23
+ kmarkdown = 9,
24
+ card = 10,
25
+ system = 255
26
+ }
27
+ export interface MessageParams {
28
+ type: Type;
29
+ msg_id: string;
30
+ chat_code: string;
31
+ target_id: string;
32
+ content: any;
33
+ quote: string;
34
+ nonce: string;
35
+ }
36
+ export interface MessageBase {
37
+ type: Type;
38
+ content: string;
39
+ }
40
+ export interface Data<E = any> extends MessageBase {
41
+ channel_type: 'GROUP' | 'PERSON' | 'WEBHOOK_CHALLENGE';
42
+ challenge: string;
43
+ verify_token: string;
44
+ target_id: string;
45
+ author_id: string;
46
+ msg_id: string;
47
+ msg_timestamp: number;
48
+ nonce: string;
49
+ extra: E;
50
+ }
51
+ type AttachmentType = 'image' | 'video' | 'audio' | 'file';
52
+ type NoticeType = 'user_updated' | 'message_btn_click' | 'added_reaction' | 'deleted_reaction' | 'updated_message' | 'deleted_message' | 'pinned_message' | 'unpinned_message' | 'joined_guild' | 'exited_guild' | 'updated_guild_member' | 'updated_guild' | 'deleted_guild' | 'self_joined_guild' | 'self_exited_guild' | 'added_role' | 'deleted_role' | 'updated_role' | 'added_block_list' | 'deleted_block_list' | 'added_emoji' | 'updated_emoji' | 'added_channel' | 'updated_channel' | 'deleted_channel' | 'updated_private_message' | 'deleted_private_message' | 'private_added_reaction' | 'private_deleted_reaction' | 'joined_channel' | 'exited_channel' | 'guild_member_online' | 'guild_member_offline';
53
+ export interface MessageMeta {
54
+ mention: string[];
55
+ mention_all: boolean;
56
+ mention_roles: string[];
57
+ mention_here: boolean;
58
+ attachments: Attachment;
59
+ quote: Message;
60
+ author: Author;
61
+ kmarkdown?: {
62
+ raw_content: string;
63
+ mention_part: KmarkdownUserMeta[];
64
+ mention_role_part: KmarkdownRoleMeta[];
65
+ };
66
+ }
67
+ export interface PrivateChat {
68
+ code: string;
69
+ last_read_time: number;
70
+ latest_msg_time: number;
71
+ unread_count: number;
72
+ is_friend: boolean;
73
+ is_blocked: boolean;
74
+ is_target_blocked: boolean;
75
+ target_info: User;
76
+ }
77
+ export interface KmarkdownUserMeta {
78
+ id: string;
79
+ username: string;
80
+ full_name: string;
81
+ avatar: string;
82
+ }
83
+ export interface KmarkdownRoleMeta {
84
+ role_id: number;
85
+ name: string;
86
+ color: number;
87
+ }
88
+ export interface MessageExtra extends MessageMeta {
89
+ type: Type;
90
+ code: string;
91
+ guild_id: string;
92
+ channel_name: string;
93
+ }
94
+ export interface Message extends MessageBase, MessageMeta {
95
+ id: string;
96
+ rong_id?: string;
97
+ embeds: any[];
98
+ reactions: any[];
99
+ mention_info: object;
100
+ extra: MessageExtra | Notice;
101
+ }
102
+ export interface MessageReturn {
103
+ msg_id: string;
104
+ msg_timestamp: number;
105
+ nonce: string;
106
+ }
107
+ export interface Card {
108
+ type: 'card';
109
+ theme?: Card.Theme;
110
+ size?: Card.Size;
111
+ modules: Card.Module[];
112
+ }
113
+ export declare namespace Card {
114
+ const Theme: readonly ["primary", "secondary", "warning", "danger", "info", "none", "success"];
115
+ type Theme = typeof Theme[number];
116
+ const Size: readonly ["lg", "sm"];
117
+ type Size = typeof Size[number];
118
+ type Module = Section | Container | ImageGroup | ActionGroup | Header | Divider | Invite | File | Countdown | Context;
119
+ interface Text {
120
+ type: 'plain-text' | 'kmarkdown';
121
+ content: string;
122
+ emoji?: boolean;
123
+ }
124
+ interface Paragraph {
125
+ type: 'paragraph';
126
+ cols: number;
127
+ fields: Text[];
128
+ }
129
+ interface Section {
130
+ type: 'section';
131
+ mode?: 'left' | 'right';
132
+ text: Text | Paragraph;
133
+ accessory?: Image | Button;
134
+ }
135
+ interface Container {
136
+ type: 'container';
137
+ elements: Image[];
138
+ }
139
+ interface Image {
140
+ type: 'image';
141
+ size?: 'lg' | 'sm';
142
+ src: string;
143
+ alt?: string;
144
+ circle?: boolean;
145
+ }
146
+ interface Button {
147
+ type: 'button';
148
+ theme?: Button.Theme;
149
+ value?: string;
150
+ text: Text;
151
+ click?: string;
152
+ }
153
+ namespace Button {
154
+ const Theme: readonly ["primary", "secondary", "warning", "danger", "info", "none", "success"];
155
+ type Theme = typeof Theme[number];
156
+ }
157
+ interface ImageGroup {
158
+ type: 'image-group';
159
+ elements: Image[];
160
+ }
161
+ interface Header {
162
+ type: 'header';
163
+ text: Text;
164
+ }
165
+ interface Divider {
166
+ type: 'divider';
167
+ }
168
+ interface Invite {
169
+ type: 'invite';
170
+ code: string;
171
+ }
172
+ interface ActionGroup {
173
+ type: 'action-group';
174
+ elements: Button[];
175
+ }
176
+ interface Context {
177
+ type: 'context';
178
+ elements: (Text | Image)[];
179
+ }
180
+ interface File {
181
+ type: 'file' | 'audio' | 'video';
182
+ src: string;
183
+ title: string;
184
+ cover?: string;
185
+ }
186
+ interface Countdown {
187
+ type: 'countdown';
188
+ endTime: number;
189
+ startTime: number;
190
+ mode: 'day' | 'hour' | 'second';
191
+ }
192
+ }
193
+ export interface User {
194
+ id: string;
195
+ username: string;
196
+ identify_num: string;
197
+ avatar: string;
198
+ online: boolean;
199
+ bot?: boolean;
200
+ roles: number[];
201
+ vip_avatar?: string;
202
+ is_vip?: boolean;
203
+ mobile_verified: boolean;
204
+ joined_at?: number;
205
+ active_time?: number;
206
+ status: UserStatus;
207
+ }
208
+ export declare enum UserStatus {
209
+ normal = 0,
210
+ normal_1 = 1,
211
+ banned = 10
212
+ }
213
+ export interface Self extends User {
214
+ status: UserStatus;
215
+ mobile_verified: boolean;
216
+ system: boolean;
217
+ mobile_prefix: string;
218
+ mobile: string;
219
+ invited_count: number;
220
+ }
221
+ export interface Author extends User {
222
+ roles: number[];
223
+ nickname?: string;
224
+ }
225
+ export interface Attachment {
226
+ type: AttachmentType;
227
+ name: string;
228
+ url: string;
229
+ file_type: string;
230
+ size: number;
231
+ duration: number;
232
+ width: number;
233
+ height: number;
234
+ }
235
+ export interface Notice {
236
+ type: NoticeType;
237
+ body: NoticeBody;
238
+ }
239
+ export interface Channel {
240
+ id: string;
241
+ name: string;
242
+ user_id: string;
243
+ user_info?: User;
244
+ guild_id: string;
245
+ is_category: boolean;
246
+ parent_id: string;
247
+ topic: string;
248
+ type: 0 | 1 | 2;
249
+ level: number;
250
+ slow_mode?: 0 | 5000 | 10000 | 15000 | 30000 | 60000 | 120000 | 300000 | 600000 | 900000 | 1800000 | 3600000 | 7200000 | 21600000;
251
+ has_password?: boolean;
252
+ limit_amount: number;
253
+ permission_overwrites?: Overwrite[];
254
+ permission_users?: any[];
255
+ permission_sync?: 0 | 1;
256
+ voice_quality?: '1' | '2' | '3';
257
+ server_url?: string;
258
+ children?: string[];
259
+ }
260
+ export interface NoticeBody extends Channel, MessageMeta, GuildRole {
261
+ value: string;
262
+ msg_id: string;
263
+ channel_type: 'GROUP' | 'PERSON';
264
+ author_id: string;
265
+ target_id: string;
266
+ channel_id: string;
267
+ operator_id: string;
268
+ emoji: Emoji;
269
+ content: string;
270
+ icon: string;
271
+ notify_type: number;
272
+ region: string;
273
+ enable_open: number;
274
+ openId: number;
275
+ default_channel_id: string;
276
+ welcome_channel_id: string;
277
+ updated_at: number;
278
+ joined_at: number;
279
+ exited_at: number;
280
+ deleted_at: number;
281
+ nickname: string;
282
+ chat_code: string;
283
+ event_time: number;
284
+ guilds: string[];
285
+ }
286
+ export interface ChannelRoleIndex {
287
+ permission_overwrites: Overwrite;
288
+ permission_users: List<User>;
289
+ permission_sync: 0 | 1;
290
+ }
291
+ export interface ChannelRole {
292
+ user_id?: string;
293
+ role_id?: string;
294
+ allow: number;
295
+ deny: number;
296
+ }
297
+ export interface Emoji {
298
+ id: string;
299
+ name: string;
300
+ }
301
+ export interface Overwrite {
302
+ role_id: number;
303
+ allow: number;
304
+ deny: number;
305
+ }
306
+ export interface ListMeta {
307
+ page: number;
308
+ page_total: number;
309
+ page_size: number;
310
+ total: number;
311
+ }
312
+ export interface List<T> {
313
+ items: T[];
314
+ meta: ListMeta;
315
+ sort: Partial<Record<keyof T, number>>;
316
+ }
317
+ export interface Guild {
318
+ id: string;
319
+ name: string;
320
+ topic: string;
321
+ master_id: string;
322
+ is_master: boolean;
323
+ icon: string;
324
+ invite_enabled: number;
325
+ notify_type: number;
326
+ region: string;
327
+ enable_open: number;
328
+ openId: string;
329
+ default_channel_id: string;
330
+ welcome_channel_id: string;
331
+ }
332
+ export interface GuildList extends List<Guild> {
333
+ }
334
+ export interface GuildUser extends User {
335
+ joined_at: number;
336
+ active_time: number;
337
+ is_master: boolean;
338
+ abbr: string;
339
+ }
340
+ export interface GuildUserList extends List<GuildUser> {
341
+ user_count: number;
342
+ online_count: number;
343
+ offline_count: number;
344
+ }
345
+ interface Pagination {
346
+ page?: number;
347
+ page_size?: number;
348
+ sort?: string[];
349
+ }
350
+ interface GuildMute {
351
+ type: GuildMute.Type;
352
+ user_ids: string[];
353
+ }
354
+ export interface GuildRole {
355
+ role_id: number;
356
+ name: string;
357
+ color: number;
358
+ position: number;
359
+ hoist: 0 | 1;
360
+ mentionable: 0 | 1;
361
+ permissions: number;
362
+ }
363
+ export interface GuildRoleReturn {
364
+ user_id: string;
365
+ guild_id: string;
366
+ roles: number[];
367
+ }
368
+ export declare enum Permissions {
369
+ GUILD_ADMIN = 0,
370
+ GUILD_MANAGE = 1,
371
+ GUILD_LOG = 2,
372
+ GUILD_INVITE_CREATE = 3,
373
+ GUILD_INVITE_MANAGE = 4,
374
+ CHANNEL_MANAGE = 5,
375
+ GUILD_USER_KICK = 6,
376
+ GUILD_USER_BAN = 7,
377
+ GUILD_EMOJI_MANAGE = 8,
378
+ GUILD_USER_NAME_CHANGE = 9,
379
+ GUILD_ROLE_MANAGE = 10,
380
+ CHANNEL_VIEW = 11,
381
+ CHANNEL_MESSAGE = 12,
382
+ CHANNEL_MANAGE_MESSAGE = 13,
383
+ CHANNEL_UPLOAD = 14,
384
+ CHANNEL_VOICE_CONNECT = 15,
385
+ CHANNEL_VOICE_MANAGE = 16,
386
+ CHANNEL_MESSAGE_AT_ALL = 17,
387
+ CHANNEL_MESSAGE_REACTION_CREATE = 18,
388
+ CHANNEL_MESSAGE_REACTION_FOLLOW = 19,
389
+ CHANNEL_VOICE_CONNECT_PASSIVE = 20,
390
+ CHANNEL_VOICE_SPEAK_KEY_ONLY = 21,
391
+ CHANNEL_VOICR_SPEAK_FREE = 22,
392
+ CHANNEL_VOICE_SPEAK = 23,
393
+ GUILD_USER_DEAFEN = 24,
394
+ GUILD_USER_MUTEGUILD_USER_NAME_CHANGE_OTHER = 25,
395
+ GUILD_USER_NAME_CHANGE_OTHER = 26,
396
+ CHANNEL_VOICE_BGM = 27
397
+ }
398
+ export declare function hasPermission(permissions: number, permission: Permissions): boolean;
399
+ export declare namespace GuildMute {
400
+ enum Type {
401
+ mic = 1,
402
+ headset = 2
403
+ }
404
+ }
405
+ export interface GuildMuteList {
406
+ mic: GuildMute;
407
+ headset: GuildMute;
408
+ }
409
+ export interface GuildBoost {
410
+ user_id: string;
411
+ guild_id: string;
412
+ start_time: number;
413
+ end_time: number;
414
+ user: User;
415
+ }
416
+ export interface Game {
417
+ id: number;
418
+ name: string;
419
+ type: 0 | 1 | 2;
420
+ options: string;
421
+ kmhook_admin: boolean;
422
+ process_name: string[];
423
+ product_name: string[];
424
+ icon: string;
425
+ }
426
+ export interface AccessToken {
427
+ access_token: string;
428
+ expires_in?: number;
429
+ token_type: 'Bearer';
430
+ scope: string;
431
+ }
432
+ export interface Intimacy {
433
+ img_url: string;
434
+ social_info: string;
435
+ last_read: number;
436
+ score: number;
437
+ img_list: {
438
+ id: string;
439
+ url: string;
440
+ }[];
441
+ }
442
+ export interface Invite {
443
+ guild_id: string;
444
+ channel_id: string;
445
+ url_code: string;
446
+ url: string;
447
+ user: User;
448
+ }
449
+ export interface BlackList {
450
+ user_id: string;
451
+ created_time: number;
452
+ remark: string;
453
+ user: User;
454
+ }
455
+ export interface Internal {
456
+ getGuildList(param?: Pagination): Promise<List<Guild>>;
457
+ getGuildView(param: {
458
+ guild_id: string;
459
+ }): Promise<Guild>;
460
+ getGuildUserList(param: {
461
+ guild_id: string;
462
+ } & Pagination): Promise<GuildUserList>;
463
+ setGuildUserNickname(param: {
464
+ guild_id: string;
465
+ user_id: string;
466
+ nickname: string;
467
+ }): Promise<void>;
468
+ leaveGuild(param: {
469
+ guild_id: string;
470
+ }): Promise<void>;
471
+ kickoutGuildUser(param: {
472
+ guild_id: string;
473
+ target_id: string;
474
+ }): Promise<void>;
475
+ getGuildMuteList(param: {
476
+ guild_id: string;
477
+ }): Promise<GuildMuteList>;
478
+ createGuildMute(param: {
479
+ guild_id: string;
480
+ user_id: string;
481
+ type: GuildMute.Type;
482
+ }): Promise<void>;
483
+ deleteGuildMute(param: {
484
+ guild_id: string;
485
+ user_id: string;
486
+ type: GuildMute.Type;
487
+ }): Promise<void>;
488
+ getGuildBoostHistory(param: {
489
+ guild_id: string;
490
+ start_time: number;
491
+ end_time: number;
492
+ }): Promise<List<GuildBoost>>;
493
+ getChannelList(param: {
494
+ guild_id: string;
495
+ } & Pagination): Promise<List<Channel>>;
496
+ getChannelView(param: {
497
+ target_id: string;
498
+ }): Promise<Channel>;
499
+ createChannel(param: {
500
+ guild_id: string;
501
+ parent_id?: string;
502
+ name: string;
503
+ type?: number;
504
+ limit_amount?: number;
505
+ voice_quality?: string;
506
+ is_category?: 0 | 1;
507
+ }): Promise<Channel>;
508
+ updateChannel(param: {
509
+ channel_id: string;
510
+ name?: string;
511
+ topic?: string;
512
+ slow_mode?: 0 | 5000 | 10000 | 15000 | 30000 | 60000 | 120000 | 300000 | 600000 | 900000 | 1800000 | 3600000 | 7200000 | 21600000;
513
+ }): Promise<Channel>;
514
+ deleteChannel(param: {
515
+ channel_id: string;
516
+ }): Promise<void>;
517
+ getChannelUserList(param: {
518
+ channel_id: string;
519
+ }): Promise<List<User>>;
520
+ kickChannelUser(param: {
521
+ channel_id: string;
522
+ user_id: string;
523
+ }): Promise<void>;
524
+ moveChannelUser(param: {
525
+ target_id: string;
526
+ user_ids: [];
527
+ }): Promise<void>;
528
+ getChannelRoleIndex(param: {
529
+ channel_id: string;
530
+ }): Promise<ChannelRoleIndex>;
531
+ createChannelRole(param: {
532
+ channel_id: string;
533
+ type?: 'user_id';
534
+ value?: string;
535
+ }): Promise<Omit<ChannelRole, 'role_id'>>;
536
+ createChannelRole(param: {
537
+ channel_id: string;
538
+ type: 'role_id';
539
+ value?: string;
540
+ }): Promise<Omit<ChannelRole, 'user_id'>>;
541
+ updateChannelRole(param: {
542
+ channel_id: string;
543
+ type?: 'user_id';
544
+ value?: string;
545
+ allow?: number;
546
+ deny?: number;
547
+ }): Promise<Omit<ChannelRole, 'role_id'>>;
548
+ updateChannelRole(param: {
549
+ channel_id: string;
550
+ type: 'role_id';
551
+ value?: string;
552
+ allow?: number;
553
+ deny?: number;
554
+ }): Promise<Omit<ChannelRole, 'user_id'>>;
555
+ deleteChannelRole(param: {
556
+ channel_id: string;
557
+ type?: 'role_id' | 'user_id';
558
+ value?: string;
559
+ }): Promise<void>;
560
+ getMessageList(param: {
561
+ target_id: string;
562
+ msg_id?: string;
563
+ pin?: 0 | 1;
564
+ flag?: 'before' | 'around' | 'after';
565
+ } & Pagination): Promise<List<Message>>;
566
+ getMessageView(param: {
567
+ msg_id: string;
568
+ }): Promise<Message>;
569
+ createMessage(param: {
570
+ type?: Type;
571
+ target_id: string;
572
+ content: string;
573
+ quote?: string;
574
+ nonce?: string;
575
+ temp_target_id?: string;
576
+ }): Promise<MessageReturn>;
577
+ updateMessage(param: {
578
+ msg_id: string;
579
+ content: string;
580
+ quote?: string;
581
+ temp_target_id?: string;
582
+ }): Promise<void>;
583
+ deleteMessage(param: {
584
+ msg_id: string;
585
+ }): Promise<void>;
586
+ getMessageReactionList(param: {
587
+ msg_id: string;
588
+ emoji: string;
589
+ }): Promise<User[]>;
590
+ addMessageReaction(param: {
591
+ msg_id: string;
592
+ emoji: string;
593
+ }): Promise<void>;
594
+ deleteMessageReaction(param: {
595
+ msg_id: string;
596
+ emoji: string;
597
+ user_id?: string;
598
+ }): Promise<void>;
599
+ getChannelJoinedUserList(param: {
600
+ guild_id: string;
601
+ user_id: string;
602
+ } & Pagination): Promise<List<Channel>>;
603
+ getPrivateChatList(param?: Pagination): Promise<List<Omit<PrivateChat, 'is_friend' | 'is_blocked' | 'is_target_blocked'>>>;
604
+ getPrivateChatView(param: {
605
+ chat_code: string;
606
+ }): Promise<PrivateChat>;
607
+ createPrivateChat(param: {
608
+ target_id: string;
609
+ }): Promise<PrivateChat>;
610
+ deletePrivateChat(param: {
611
+ chat_code: string;
612
+ }): Promise<void>;
613
+ getDirectMessageList(param: {
614
+ target_id?: string;
615
+ chat_code?: string;
616
+ msg_id?: string;
617
+ flag?: 'before' | 'around' | 'after';
618
+ } & Pagination): Promise<{
619
+ items: Message[];
620
+ }>;
621
+ createDirectMessage(param: {
622
+ target_id?: string;
623
+ chat_code?: string;
624
+ type?: Type;
625
+ content: string;
626
+ quote?: string;
627
+ nonce?: string;
628
+ }): Promise<MessageReturn>;
629
+ updateDirectMessage(param: {
630
+ msg_id: string;
631
+ content: string;
632
+ quote?: string;
633
+ }): Promise<void>;
634
+ deleteDirectMessage(param: {
635
+ msg_id: string;
636
+ }): Promise<void>;
637
+ getDirectMessageReactionList(param: {
638
+ msg_id: string;
639
+ emoji?: string;
640
+ }): Promise<User[]>;
641
+ addDirectMessageReaction(param: {
642
+ msg_id: string;
643
+ emoji: string;
644
+ }): Promise<void>;
645
+ deleteDirectMessageReaction(param: {
646
+ msg_id: string;
647
+ emoji: string;
648
+ user_id?: string;
649
+ }): Promise<void>;
650
+ getGateway(param: {
651
+ compress?: 0 | 1;
652
+ }): Promise<{
653
+ url: string;
654
+ }>;
655
+ getToken(param: {
656
+ grant_type: 'authorization_code';
657
+ client_id: string;
658
+ client_secret: string;
659
+ code: string;
660
+ redirect_uri: string;
661
+ }): Promise<AccessToken>;
662
+ getUserMe(): Promise<User>;
663
+ getUserView(param: {
664
+ user_id: string;
665
+ guild_id?: string;
666
+ }): Promise<User>;
667
+ offline(): Promise<void>;
668
+ getGuildRoleList(param: {
669
+ guild_id: string;
670
+ } & Pagination): Promise<List<GuildRole>>;
671
+ createGuildRole(param: {
672
+ name?: string;
673
+ guild_id: string;
674
+ }): Promise<GuildRole>;
675
+ updateGuildRole(param: {
676
+ guild_id: string;
677
+ role_id: number;
678
+ } & Partial<Omit<GuildRole, 'role_id'>>): Promise<GuildRole>;
679
+ deleteGuildRole(param: {
680
+ guild_id: string;
681
+ role_id: number;
682
+ }): Promise<void>;
683
+ grantGuildRole(param: {
684
+ guild_id: string;
685
+ user_id?: string;
686
+ role_id: number;
687
+ }): Promise<GuildRoleReturn>;
688
+ revokeGuildRole(param: {
689
+ guild_id: string;
690
+ user_id?: string;
691
+ role_id: number;
692
+ }): Promise<GuildRoleReturn>;
693
+ getIntimacy(param: {
694
+ user_id: string;
695
+ }): Promise<Intimacy>;
696
+ updateIntimacy(param: {
697
+ user_id: string;
698
+ score?: number;
699
+ social_info?: string;
700
+ img_id?: string;
701
+ }): Promise<void>;
702
+ getGuildEmojiList(param?: Pagination): Promise<List<Emoji>>;
703
+ updateGuildEmoji(param: {
704
+ name: string;
705
+ id: string;
706
+ }): Promise<void>;
707
+ deleteGuildEmoji(param: {
708
+ id: string;
709
+ }): Promise<void>;
710
+ getInviteList(param: {
711
+ guild_id?: string;
712
+ channel_id?: string;
713
+ } & Pagination): Promise<List<Invite>>;
714
+ createInvite(param: {
715
+ guild_id?: string;
716
+ channel_id?: string;
717
+ duration?: number;
718
+ setting_times?: number;
719
+ }): Promise<{
720
+ url: string;
721
+ }>;
722
+ deleteInvite(param: {
723
+ url_code: string;
724
+ guild_id?: string;
725
+ channel_id?: string;
726
+ }): Promise<void>;
727
+ getBlacklist(param: {
728
+ guild_id: string;
729
+ } & Pagination): Promise<List<BlackList>>;
730
+ createBlacklist(param: {
731
+ guild_id: string;
732
+ target_id: string;
733
+ remark?: string;
734
+ del_msg_days?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7;
735
+ }): Promise<void>;
736
+ deleteBlacklist(param: {
737
+ guild_id: string;
738
+ target_id: string;
739
+ }): Promise<void>;
740
+ getGameList(param?: {
741
+ type?: 0 | 1 | 2;
742
+ }): Promise<List<Game>>;
743
+ createGame(param: {
744
+ name: string;
745
+ icon?: string;
746
+ }): Promise<List<Game>>;
747
+ updateGame(param: {
748
+ id: number;
749
+ name?: string;
750
+ icon?: string;
751
+ }): Promise<List<Game>>;
752
+ deleteGame(param: {
753
+ id: number;
754
+ }): Promise<void>;
755
+ createGameActivity(param: {
756
+ id: number;
757
+ data_type: 1 | 2;
758
+ software?: 'cloudmusic' | 'qqmusic' | 'kugou';
759
+ singer?: string;
760
+ music_name?: string;
761
+ }): Promise<void>;
762
+ deleteGameActivity(param: {
763
+ data_type: 1 | 2;
764
+ }): Promise<void>;
765
+ hasPermission(permissions: number, permission: Permissions): boolean;
766
+ }
767
+ export interface Events {
768
+ 'kook/updated-message'(input: any, bot: KookBot): void;
769
+ 'kook/updated-private-message'(input: any, bot: KookBot): void;
770
+ 'kook/deleted-message'(input: any, bot: KookBot): void;
771
+ 'kook/deleted-private-message'(input: any, bot: KookBot): void;
772
+ 'kook/added-reaction'(input: any, bot: KookBot): void;
773
+ 'kook/private-added-reaction'(input: any, bot: KookBot): void;
774
+ 'kook/deleted-reaction'(input: any, bot: KookBot): void;
775
+ 'kook/private-deleted-reaction'(input: any, bot: KookBot): void;
776
+ 'kook/updated-channel'(input: any, bot: KookBot): void;
777
+ 'kook/deleted-channel'(input: any, bot: KookBot): void;
778
+ 'kook/pinned-message'(input: any, bot: KookBot): void;
779
+ 'kook/unpinned-message'(input: any, bot: KookBot): void;
780
+ 'kook/joined-guild'(input: any, bot: KookBot): void;
781
+ 'kook/exited-guild'(input: any, bot: KookBot): void;
782
+ 'kook/updated-guild'(input: any, bot: KookBot): void;
783
+ 'kook/deleted-guild'(input: any, bot: KookBot): void;
784
+ 'kook/self-joined-guild'(input: any, bot: KookBot): void;
785
+ 'kook/self-exited-guild'(input: any, bot: KookBot): void;
786
+ 'kook/update-guild-member'(input: any, bot: KookBot): void;
787
+ 'kook/guild-member-online'(input: any, bot: KookBot): void;
788
+ 'kook/guild-member-offline'(input: any, bot: KookBot): void;
789
+ 'kook/added-role'(input: any, bot: KookBot): void;
790
+ 'kook/deleted-role'(input: any, bot: KookBot): void;
791
+ 'kook/updated-role'(input: any, bot: KookBot): void;
792
+ 'kook/added-block-list'(input: any, bot: KookBot): void;
793
+ 'kook/deleted-block-list'(input: any, bot: KookBot): void;
794
+ 'kook/added-emoji'(input: any, bot: KookBot): void;
795
+ 'kook/updated-emoji'(input: any, bot: KookBot): void;
796
+ 'kook/joined-channel'(input: any, bot: KookBot): void;
797
+ 'kook/exited-channel'(input: any, bot: KookBot): void;
798
+ 'kook/user-updated'(input: any, bot: KookBot): void;
799
+ 'kook/message-btn-click'(input: any, bot: KookBot): void;
800
+ }
801
+ export declare class Internal {
802
+ private readonly request;
803
+ constructor(request: KookRequest);
804
+ static define(name: string, method: string, path: string): void;
805
+ }
806
+ export {};
807
+ //# sourceMappingURL=types.d.ts.map