@alemonjs/kook 0.2.2 → 0.2.5

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.
@@ -1,221 +1,192 @@
1
- type MessageType = 1 | 2 | 3 | 4 | 8 | 9 | 10 | 255
1
+ type MessageType = 1 | 2 | 3 | 4 | 8 | 9 | 10 | 255;
2
2
  /**
3
3
  * 消息通道类型, GROUP 为组播消息, PERSON 为单播消息, BROADCAST 为广播消息
4
4
  */
5
- type MessageChannelType = 'GROUP' | 'PERSON' | 'BROADCAST'
5
+ type MessageChannelType = 'GROUP' | 'PERSON' | 'BROADCAST';
6
6
  /**
7
7
  * 会话数据
8
8
  */
9
9
  interface EventData {
10
- channel_type: MessageChannelType
11
- type: MessageType
12
- target_id: string
13
- author_id: string
14
- content: string
15
- extra: Extra
16
- msg_id: string
17
- msg_timestamp: number
18
- nonce: string
19
- from_type: number
10
+ channel_type: MessageChannelType;
11
+ type: MessageType;
12
+ target_id: string;
13
+ author_id: string;
14
+ content: string;
15
+ extra: Extra;
16
+ msg_id: string;
17
+ msg_timestamp: number;
18
+ nonce: string;
19
+ from_type: number;
20
20
  }
21
21
  /**
22
22
  * 消息发送参数
23
23
  */
24
24
  interface SendMessageParams {
25
- /**
26
- * 消息类型
27
- */
28
- type?: number
29
- /**
30
- * 频道编号
31
- */
32
- target_id: string
33
- /**
34
- * 消息内容
35
- */
36
- content: string
37
- /**
38
- * 引用--消息id
39
- */
40
- quote?: string
41
- nonce?: string
42
- temp_target_id?: string
25
+ /**
26
+ * 消息类型
27
+ */
28
+ type?: number;
29
+ /**
30
+ * 频道编号
31
+ */
32
+ target_id: string;
33
+ /**
34
+ * 消息内容
35
+ */
36
+ content: string;
37
+ /**
38
+ * 引用--消息id
39
+ */
40
+ quote?: string;
41
+ nonce?: string;
42
+ temp_target_id?: string;
43
43
  }
44
44
  /**
45
45
  * 作者信息
46
46
  */
47
47
  interface Author {
48
- id: string
49
- username: string
50
- identify_num: string
51
- online: boolean
52
- os: string
53
- status: number
54
- avatar: string
55
- vip_avatar: string
56
- banner: string
57
- nickname: string
58
- roles: string[]
59
- is_vip: boolean
60
- vip_amp: boolean
61
- is_ai_reduce_noise: boolean
62
- is_personal_card_bg: boolean
63
- bot: boolean
64
- decorations_id_map: null | unknown
65
- is_sys: boolean
48
+ id: string;
49
+ username: string;
50
+ identify_num: string;
51
+ online: boolean;
52
+ os: string;
53
+ status: number;
54
+ avatar: string;
55
+ vip_avatar: string;
56
+ banner: string;
57
+ nickname: string;
58
+ roles: string[];
59
+ is_vip: boolean;
60
+ vip_amp: boolean;
61
+ is_ai_reduce_noise: boolean;
62
+ is_personal_card_bg: boolean;
63
+ bot: boolean;
64
+ decorations_id_map: null | unknown;
65
+ is_sys: boolean;
66
66
  }
67
67
  /**
68
68
  * mk接口
69
69
  */
70
70
  interface KMarkdown {
71
- raw_content: string
72
- mention_part: any[]
73
- mention_role_part: any[]
74
- channel_part: any[]
71
+ raw_content: string;
72
+ mention_part: any[];
73
+ mention_role_part: any[];
74
+ channel_part: any[];
75
75
  }
76
76
  /**
77
77
  * 数据包
78
78
  */
79
79
  interface Extra {
80
- type: number
81
- code: string
82
- guild_id: string
83
- guild_type: number
84
- channel_name: string
85
- author: Author
86
- visible_only: null
87
- mention: any[]
88
- mention_all: boolean
89
- mention_roles: any[]
90
- mention_here: boolean
91
- nav_channels: any[]
92
- kmarkdown: KMarkdown
93
- emoji: any[]
94
- last_msg_content: string
95
- send_msg_device: number
80
+ type: number;
81
+ code: string;
82
+ guild_id: string;
83
+ guild_type: number;
84
+ channel_name: string;
85
+ author: Author;
86
+ visible_only: null;
87
+ mention: any[];
88
+ mention_all: boolean;
89
+ mention_roles: any[];
90
+ mention_here: boolean;
91
+ nav_channels: any[];
92
+ kmarkdown: KMarkdown;
93
+ emoji: any[];
94
+ last_msg_content: string;
95
+ send_msg_device: number;
96
96
  }
97
97
  /**
98
98
  * 私聊消息
99
99
  */
100
100
  interface SendDirectMessageParams {
101
- type?: MessageType
102
- target_id?: string
103
- chat_code?: string
104
- content: string
105
- quote?: string
106
- nonce?: string
101
+ type?: MessageType;
102
+ target_id?: string;
103
+ chat_code?: string;
104
+ content: string;
105
+ quote?: string;
106
+ nonce?: string;
107
107
  }
108
108
  /**
109
109
  * 系统数据
110
110
  */
111
111
  interface SystemData {
112
- channel_type: MessageChannelType
113
- type: number
114
- target_id: string
115
- author_id: string
116
- content: string
117
- extra: {
118
- type: (typeof SystemDataEnum)[number]
119
- body: overheadData | memberData | ChannelData | StatementData | EditingData | OnLineData
120
- }
121
- msg_id: string
122
- msg_timestamp: number
123
- nonce: string
124
- from_type: number
112
+ channel_type: MessageChannelType;
113
+ type: number;
114
+ target_id: string;
115
+ author_id: string;
116
+ content: string;
117
+ extra: {
118
+ type: (typeof SystemDataEnum)[number];
119
+ body: overheadData | memberData | ChannelData | StatementData | EditingData | OnLineData;
120
+ };
121
+ msg_id: string;
122
+ msg_timestamp: number;
123
+ nonce: string;
124
+ from_type: number;
125
125
  }
126
126
  interface OnLineData {
127
- user_id: string
128
- event_time: number
129
- guilds: any[]
127
+ user_id: string;
128
+ event_time: number;
129
+ guilds: any[];
130
130
  }
131
131
  interface overheadData {
132
- channel_id: string
133
- operator_id: string
134
- msg_id: string
132
+ channel_id: string;
133
+ operator_id: string;
134
+ msg_id: string;
135
135
  }
136
136
  interface memberData {
137
- user_id: string
138
- exited_at: number
137
+ user_id: string;
138
+ exited_at: number;
139
139
  }
140
140
  interface ChannelData {
141
- id: string
142
- name: string
143
- user_id: string
144
- guild_id: string
145
- guild_type: number
146
- limit_amount: number
147
- is_category: number
148
- parent_id: string
149
- level: number
150
- slow_mode: number
151
- topic: string
152
- type: number
153
- permission_overwrites: any[]
154
- permission_users: any[]
155
- permission_sync: number
156
- mode: number
157
- has_password: boolean
158
- last_msg_content: string
159
- last_msg_id: string
160
- sync_guild_region: number
161
- region: string
162
- joined_at: number
141
+ id: string;
142
+ name: string;
143
+ user_id: string;
144
+ guild_id: string;
145
+ guild_type: number;
146
+ limit_amount: number;
147
+ is_category: number;
148
+ parent_id: string;
149
+ level: number;
150
+ slow_mode: number;
151
+ topic: string;
152
+ type: number;
153
+ permission_overwrites: any[];
154
+ permission_users: any[];
155
+ permission_sync: number;
156
+ mode: number;
157
+ has_password: boolean;
158
+ last_msg_content: string;
159
+ last_msg_id: string;
160
+ sync_guild_region: number;
161
+ region: string;
162
+ joined_at: number;
163
163
  }
164
164
  interface StatementData {
165
- channel_id: string
166
- emoji: {
167
- [key: string]: any
168
- }
169
- user_id: string
170
- msg_id: string
165
+ channel_id: string;
166
+ emoji: {
167
+ [key: string]: any;
168
+ };
169
+ user_id: string;
170
+ msg_id: string;
171
171
  }
172
172
  interface EditingData {
173
- version_id: string
174
- channel_id: string
175
- target_id: string
176
- content: string
177
- mention: string[]
178
- mention_all: boolean
179
- mention_here: boolean
180
- mention_roles: string[]
181
- updated_at: number
182
- kmarkdown: any
183
- last_msg_content: string
184
- embeds: any[]
185
- msg_id: string
173
+ version_id: string;
174
+ channel_id: string;
175
+ target_id: string;
176
+ content: string;
177
+ mention: string[];
178
+ mention_all: boolean;
179
+ mention_here: boolean;
180
+ mention_roles: string[];
181
+ updated_at: number;
182
+ kmarkdown: any;
183
+ last_msg_content: string;
184
+ embeds: any[];
185
+ msg_id: string;
186
186
  }
187
187
  /**
188
188
  * 系统数据可枚举
189
189
  */
190
- declare const SystemDataEnum: readonly [
191
- 'exited_guild',
192
- 'joined_guild',
193
- 'joined_channel',
194
- 'exited_channel',
195
- 'updated_channel',
196
- 'pinned_message',
197
- 'guild_member_online',
198
- 'added_reaction',
199
- 'deleted_reaction',
200
- 'updated_message',
201
- 'message_btn_click'
202
- ]
190
+ declare const SystemDataEnum: readonly ["exited_guild", "joined_guild", "joined_channel", "exited_channel", "updated_channel", "pinned_message", "guild_member_online", "added_reaction", "deleted_reaction", "updated_message", "message_btn_click"];
203
191
 
204
- export {
205
- type Author,
206
- type ChannelData,
207
- type EditingData,
208
- type EventData,
209
- type Extra,
210
- type KMarkdown,
211
- type MessageChannelType,
212
- type MessageType,
213
- type OnLineData,
214
- type SendDirectMessageParams,
215
- type SendMessageParams,
216
- type StatementData,
217
- type SystemData,
218
- SystemDataEnum,
219
- type memberData,
220
- type overheadData
221
- }
192
+ export { type Author, type ChannelData, type EditingData, type EventData, type Extra, type KMarkdown, type MessageChannelType, type MessageType, type OnLineData, type SendDirectMessageParams, type SendMessageParams, type StatementData, type SystemData, SystemDataEnum, type memberData, type overheadData };