node-karin 0.12.13 → 0.12.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/adapter/input/index.d.ts +1 -1
- package/lib/adapter/input/index.js +1 -1
- package/lib/adapter/onebot/11/event.js +90 -84
- package/lib/adapter/onebot/11/index.d.ts +89 -127
- package/lib/adapter/onebot/11/index.js +192 -254
- package/lib/cli/index.js +2 -2
- package/lib/core/init/config.js +1 -1
- package/lib/core/karin/karin.d.ts +21 -30
- package/lib/core/karin/karin.js +7 -9
- package/lib/core/listener/listener.js +11 -11
- package/lib/core/plugin/base.d.ts +7 -21
- package/lib/core/plugin/base.js +2 -6
- package/lib/core/plugin/loader.d.ts +5 -15
- package/lib/core/plugin/loader.js +5 -15
- package/lib/core/server/server.js +4 -4
- package/lib/event/handler/base.d.ts +1 -3
- package/lib/event/handler/base.js +1 -3
- package/lib/event/handler/message.js +9 -3
- package/lib/event/handler/notice.js +38 -32
- package/lib/event/handler/request.js +6 -6
- package/lib/index.d.ts +6 -0
- package/lib/index.js +6 -0
- package/lib/modules.d.ts +2 -2
- package/lib/modules.js +3 -2
- package/lib/types/adapter/accept.d.ts +24 -0
- package/lib/types/adapter/accept.js +1 -0
- package/lib/types/adapter/api.d.ts +88 -264
- package/lib/types/adapter/base.d.ts +3 -3
- package/lib/types/config/config.d.ts +4 -12
- package/lib/types/element/element.d.ts +119 -349
- package/lib/types/element/qqbot.d.ts +4 -12
- package/lib/types/event/contact.d.ts +6 -12
- package/lib/types/event/event.d.ts +59 -163
- package/lib/types/event/message.d.ts +11 -31
- package/lib/types/event/message.js +10 -12
- package/lib/types/event/notice.d.ts +118 -325
- package/lib/types/event/notice.js +8 -10
- package/lib/types/event/request.d.ts +29 -66
- package/lib/types/event/request.js +8 -10
- package/lib/types/event/sender.d.ts +7 -21
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.js +1 -0
- package/lib/types/onebot11/api.d.ts +49 -49
- package/lib/types/onebot11/event.d.ts +131 -347
- package/lib/types/onebot11/params.d.ts +184 -456
- package/lib/types/onebot11/response.d.ts +159 -381
- package/lib/types/onebot11/segment.d.ts +25 -75
- package/lib/types/onebot11/sender.d.ts +13 -39
- package/lib/types/plugin/app.d.ts +7 -11
- package/lib/types/plugin/plugin.d.ts +55 -165
- package/lib/types/render/render.d.ts +16 -48
- package/lib/utils/common/common.js +4 -2
- package/lib/utils/config/config.js +1 -1
- package/lib/utils/core/logger.js +3 -3
- package/lib/utils/core/segment.d.ts +28 -59
- package/lib/utils/core/segment.js +26 -30
- package/lib/utils/tools/restart.d.ts +3 -3
- package/lib/utils/tools/restart.js +5 -5
- package/package.json +1 -2
|
@@ -1,48 +1,26 @@
|
|
|
1
1
|
import { KarinEventType, BaseEventDataType, EventType, NoticeSubType } from './event.js';
|
|
2
|
-
/**
|
|
3
|
-
* - 私聊戳一戳
|
|
4
|
-
*/
|
|
2
|
+
/** 私聊戳一戳 */
|
|
5
3
|
export interface PrivatePokeType {
|
|
6
|
-
/**
|
|
7
|
-
* - 操作者uid
|
|
8
|
-
*/
|
|
4
|
+
/** 操作者uid */
|
|
9
5
|
operator_uid: string;
|
|
10
|
-
/**
|
|
11
|
-
* - 操作者uin
|
|
12
|
-
*/
|
|
6
|
+
/** 操作者uin */
|
|
13
7
|
operator_uin: string;
|
|
14
|
-
/**
|
|
15
|
-
* - 操作名称,如“戳了戳”
|
|
16
|
-
*/
|
|
8
|
+
/** 操作名称,如“戳了戳” */
|
|
17
9
|
action: string;
|
|
18
|
-
/**
|
|
19
|
-
* - 后缀,未设置则未空字符串
|
|
20
|
-
*/
|
|
10
|
+
/** 后缀,未设置则未空字符串 */
|
|
21
11
|
suffix: string;
|
|
22
|
-
/**
|
|
23
|
-
* - 操作图标url
|
|
24
|
-
*/
|
|
12
|
+
/** 操作图标url */
|
|
25
13
|
action_image: string;
|
|
26
14
|
}
|
|
27
|
-
/**
|
|
28
|
-
* - 私聊撤回消息
|
|
29
|
-
*/
|
|
15
|
+
/** 私聊撤回消息 */
|
|
30
16
|
export interface PrivateRecallType {
|
|
31
|
-
/**
|
|
32
|
-
* - 操作者uid
|
|
33
|
-
*/
|
|
17
|
+
/** 操作者uid */
|
|
34
18
|
operator_uid: string;
|
|
35
|
-
/**
|
|
36
|
-
* - 操作者uin
|
|
37
|
-
*/
|
|
19
|
+
/** 操作者uin */
|
|
38
20
|
operator_uin: string;
|
|
39
|
-
/**
|
|
40
|
-
* - 撤回的消息id
|
|
41
|
-
*/
|
|
21
|
+
/** 撤回的消息id */
|
|
42
22
|
message_id: string;
|
|
43
|
-
/**
|
|
44
|
-
* - 操作名称,如“撤回了一条消息” 一般此项为空字符串
|
|
45
|
-
*/
|
|
23
|
+
/** 操作名称,如“撤回了一条消息” 一般此项为空字符串 */
|
|
46
24
|
tip_text: string;
|
|
47
25
|
}
|
|
48
26
|
/**
|
|
@@ -50,70 +28,38 @@ export interface PrivateRecallType {
|
|
|
50
28
|
* - 文件信息最少需要提供一个url
|
|
51
29
|
*/
|
|
52
30
|
export interface PrivateFileUploadedType {
|
|
53
|
-
/**
|
|
54
|
-
* - 操作者uid
|
|
55
|
-
*/
|
|
31
|
+
/** 操作者uid */
|
|
56
32
|
operator_uid: string;
|
|
57
|
-
/**
|
|
58
|
-
* - 操作者uin
|
|
59
|
-
*/
|
|
33
|
+
/** 操作者uin */
|
|
60
34
|
operator_uin: string;
|
|
61
|
-
/**
|
|
62
|
-
* - 文件ID 此项没有则为空字符串
|
|
63
|
-
*/
|
|
35
|
+
/** 文件ID 此项没有则为空字符串 */
|
|
64
36
|
file_id: string;
|
|
65
|
-
/**
|
|
66
|
-
* - 文件子ID 此项没有则为空字符串
|
|
67
|
-
*/
|
|
37
|
+
/** 文件子ID 此项没有则为空字符串 */
|
|
68
38
|
file_sub_id: number;
|
|
69
|
-
/**
|
|
70
|
-
* - 文件名 此项没有则为空字符串
|
|
71
|
-
*/
|
|
39
|
+
/** 文件名 此项没有则为空字符串 */
|
|
72
40
|
file_name: string;
|
|
73
|
-
/**
|
|
74
|
-
* - 文件大小 此项没有则为0
|
|
75
|
-
*/
|
|
41
|
+
/** 文件大小 此项没有则为0 */
|
|
76
42
|
file_size: number;
|
|
77
|
-
/**
|
|
78
|
-
* - 过期时间 此项没有则为0
|
|
79
|
-
*/
|
|
43
|
+
/** 过期时间 此项没有则为0 */
|
|
80
44
|
expire_time: number;
|
|
81
|
-
/**
|
|
82
|
-
* - 文件URL
|
|
83
|
-
*/
|
|
45
|
+
/** 文件URL */
|
|
84
46
|
file_url: string;
|
|
85
47
|
}
|
|
86
|
-
/**
|
|
87
|
-
* - 群聊戳一戳
|
|
88
|
-
*/
|
|
48
|
+
/** 群聊戳一戳 */
|
|
89
49
|
export interface GroupPokeType {
|
|
90
|
-
/**
|
|
91
|
-
* - 操作者uid
|
|
92
|
-
*/
|
|
50
|
+
/** 操作者uid */
|
|
93
51
|
operator_uid: string;
|
|
94
|
-
/**
|
|
95
|
-
* - 操作者uin
|
|
96
|
-
*/
|
|
52
|
+
/** 操作者uin */
|
|
97
53
|
operator_uin: string;
|
|
98
|
-
/**
|
|
99
|
-
* - 目标uid 一般为被戳的uid
|
|
100
|
-
*/
|
|
54
|
+
/** 目标uid 一般为被戳的uid */
|
|
101
55
|
target_uid: string;
|
|
102
|
-
/**
|
|
103
|
-
* - 目标uin 一般为被戳的uin
|
|
104
|
-
*/
|
|
56
|
+
/** 目标uin 一般为被戳的uin */
|
|
105
57
|
target_uin: string;
|
|
106
|
-
/**
|
|
107
|
-
* - 操作名称,如“戳了戳”
|
|
108
|
-
*/
|
|
58
|
+
/** 操作名称,如“戳了戳” */
|
|
109
59
|
action: string;
|
|
110
|
-
/**
|
|
111
|
-
* - 后缀,未设置则未空字符串
|
|
112
|
-
*/
|
|
60
|
+
/** 后缀,未设置则未空字符串 */
|
|
113
61
|
suffix: string;
|
|
114
|
-
/**
|
|
115
|
-
* - 操作图标url
|
|
116
|
-
*/
|
|
62
|
+
/** 操作图标url */
|
|
117
63
|
action_image: string;
|
|
118
64
|
}
|
|
119
65
|
/**
|
|
@@ -122,29 +68,17 @@ export interface GroupPokeType {
|
|
|
122
68
|
* - 撤回别人消息时,operator为操作者,target为被撤回者
|
|
123
69
|
*/
|
|
124
70
|
export interface GroupRecallType {
|
|
125
|
-
/**
|
|
126
|
-
* - 操作者uid
|
|
127
|
-
*/
|
|
71
|
+
/** 操作者uid */
|
|
128
72
|
operator_uid: string;
|
|
129
|
-
/**
|
|
130
|
-
* - 操作者uin
|
|
131
|
-
*/
|
|
73
|
+
/** 操作者uin */
|
|
132
74
|
operator_uin: string;
|
|
133
|
-
/**
|
|
134
|
-
* - 目标uid
|
|
135
|
-
*/
|
|
75
|
+
/** 目标uid */
|
|
136
76
|
target_uid: string;
|
|
137
|
-
/**
|
|
138
|
-
* - 目标uin
|
|
139
|
-
*/
|
|
77
|
+
/** 目标uin */
|
|
140
78
|
target_uin: string;
|
|
141
|
-
/**
|
|
142
|
-
* - 撤回的消息id
|
|
143
|
-
*/
|
|
79
|
+
/** 撤回的消息id */
|
|
144
80
|
message_id: string;
|
|
145
|
-
/**
|
|
146
|
-
* - 操作名称,如“撤回了一条消息” 一般此项为空字符串
|
|
147
|
-
*/
|
|
81
|
+
/** 操作名称,如“撤回了一条消息” 一般此项为空字符串 */
|
|
148
82
|
tip_text: string;
|
|
149
83
|
}
|
|
150
84
|
/**
|
|
@@ -152,296 +86,163 @@ export interface GroupRecallType {
|
|
|
152
86
|
* - 文件信息最少需要提供一个url
|
|
153
87
|
*/
|
|
154
88
|
export interface GroupFileUploadedType {
|
|
155
|
-
/**
|
|
156
|
-
* - 操作者uid
|
|
157
|
-
*/
|
|
89
|
+
/** 操作者uid */
|
|
158
90
|
operator_uid: string;
|
|
159
|
-
/**
|
|
160
|
-
* - 操作者uin
|
|
161
|
-
*/
|
|
91
|
+
/** 操作者uin */
|
|
162
92
|
operator_uin: string;
|
|
163
|
-
/**
|
|
164
|
-
* - 文件ID 此项没有则为空字符串
|
|
165
|
-
*/
|
|
93
|
+
/** 文件ID 此项没有则为空字符串 */
|
|
166
94
|
file_id: string;
|
|
167
|
-
/**
|
|
168
|
-
* - 文件子ID 此项没有则为0
|
|
169
|
-
*/
|
|
95
|
+
/** 文件子ID 此项没有则为0 */
|
|
170
96
|
file_sub_id: number;
|
|
171
|
-
/**
|
|
172
|
-
* - 文件名 此项没有则为空字符串
|
|
173
|
-
*/
|
|
97
|
+
/** 文件名 此项没有则为空字符串 */
|
|
174
98
|
file_name: string;
|
|
175
|
-
/**
|
|
176
|
-
* - 文件大小 此项没有则为0
|
|
177
|
-
*/
|
|
99
|
+
/** 文件大小 此项没有则为0 */
|
|
178
100
|
file_size: number;
|
|
179
|
-
/**
|
|
180
|
-
* - 过期时间 此项没有则为0
|
|
181
|
-
*/
|
|
101
|
+
/** 过期时间 此项没有则为0 */
|
|
182
102
|
expire_time: number;
|
|
183
|
-
/**
|
|
184
|
-
* - 文件URL
|
|
185
|
-
*/
|
|
103
|
+
/** 文件URL */
|
|
186
104
|
file_url: string;
|
|
187
105
|
}
|
|
188
|
-
/**
|
|
189
|
-
* - 群名片变动
|
|
190
|
-
*/
|
|
106
|
+
/** 群名片变动 */
|
|
191
107
|
export interface GroupCardChangedType {
|
|
192
|
-
/**
|
|
193
|
-
* - 操作者uid
|
|
194
|
-
*/
|
|
108
|
+
/** 操作者uid */
|
|
195
109
|
operator_uid: string;
|
|
196
|
-
/**
|
|
197
|
-
* - 操作者uin
|
|
198
|
-
*/
|
|
110
|
+
/** 操作者uin */
|
|
199
111
|
operator_uin: string;
|
|
200
|
-
/**
|
|
201
|
-
* - 目标uid
|
|
202
|
-
*/
|
|
112
|
+
/** 目标uid */
|
|
203
113
|
target_uid: string;
|
|
204
|
-
/**
|
|
205
|
-
* - 目标uin
|
|
206
|
-
*/
|
|
114
|
+
/** 目标uin */
|
|
207
115
|
target_uin: string;
|
|
208
|
-
/**
|
|
209
|
-
* - 新名片
|
|
210
|
-
*/
|
|
116
|
+
/** 新名片 */
|
|
211
117
|
new_card: string;
|
|
212
118
|
}
|
|
213
|
-
/**
|
|
214
|
-
* - 群成员头衔变动
|
|
215
|
-
*/
|
|
119
|
+
/** 群成员头衔变动 */
|
|
216
120
|
export interface GroupMemberUniqueTitleChangedType {
|
|
217
|
-
/**
|
|
218
|
-
* - 目标uid
|
|
219
|
-
*/
|
|
121
|
+
/** 目标uid */
|
|
220
122
|
target_uid: string;
|
|
221
|
-
/**
|
|
222
|
-
* - 目标uin
|
|
223
|
-
*/
|
|
123
|
+
/** 目标uin */
|
|
224
124
|
target_uin: string;
|
|
225
|
-
/**
|
|
226
|
-
* - 新头衔
|
|
227
|
-
*/
|
|
125
|
+
/** 新头衔 */
|
|
228
126
|
title: string;
|
|
229
127
|
}
|
|
230
|
-
/**
|
|
231
|
-
* - 群精华消息变动
|
|
232
|
-
*/
|
|
128
|
+
/** 群精华消息变动 */
|
|
233
129
|
export interface GroupEssenceChangedType {
|
|
234
|
-
/**
|
|
235
|
-
* - 群ID
|
|
236
|
-
*/
|
|
130
|
+
/** 群ID */
|
|
237
131
|
group_id: string;
|
|
238
|
-
/**
|
|
239
|
-
* - 操作者uid
|
|
240
|
-
*/
|
|
132
|
+
/** 操作者uid */
|
|
241
133
|
operator_uid: string;
|
|
242
|
-
/**
|
|
243
|
-
* - 操作者uin
|
|
244
|
-
*/
|
|
134
|
+
/** 操作者uin */
|
|
245
135
|
operator_uin: string;
|
|
246
|
-
/**
|
|
247
|
-
* - 目标uid
|
|
248
|
-
*/
|
|
136
|
+
/** 目标uid */
|
|
249
137
|
target_uid: string;
|
|
250
|
-
/**
|
|
251
|
-
* - 目标uin
|
|
252
|
-
*/
|
|
138
|
+
/** 目标uin */
|
|
253
139
|
target_uin: string;
|
|
254
|
-
/**
|
|
255
|
-
* - 被操作的消息id
|
|
256
|
-
*/
|
|
140
|
+
/** 被操作的消息id */
|
|
257
141
|
message_id: string;
|
|
258
|
-
/**
|
|
259
|
-
* - 设置、取消精华
|
|
260
|
-
*/
|
|
142
|
+
/** 设置、取消精华 */
|
|
261
143
|
is_set: boolean;
|
|
262
144
|
}
|
|
263
|
-
/**
|
|
264
|
-
* - 群成员增加
|
|
265
|
-
*/
|
|
145
|
+
/** 群成员增加 */
|
|
266
146
|
export interface GroupMemberIncreaseType {
|
|
267
|
-
/**
|
|
268
|
-
* - 群ID
|
|
269
|
-
*/
|
|
147
|
+
/** 群ID */
|
|
270
148
|
group_id: string;
|
|
271
|
-
/**
|
|
272
|
-
* - 操作者uid
|
|
273
|
-
*/
|
|
149
|
+
/** 操作者uid */
|
|
274
150
|
operator_uid: string;
|
|
275
|
-
/**
|
|
276
|
-
* - 操作者uin
|
|
277
|
-
*/
|
|
151
|
+
/** 操作者uin */
|
|
278
152
|
operator_uin: string;
|
|
279
|
-
/**
|
|
280
|
-
* - 目标uid
|
|
281
|
-
*/
|
|
153
|
+
/** 目标uid */
|
|
282
154
|
target_uid: string;
|
|
283
|
-
/**
|
|
284
|
-
* - 目标uin
|
|
285
|
-
*/
|
|
155
|
+
/** 目标uin */
|
|
286
156
|
target_uin: string;
|
|
287
|
-
/**
|
|
288
|
-
* - 加入方式 APPROVE:管理员批准 INVITE:管理员邀请
|
|
289
|
-
*/
|
|
157
|
+
/** 加入方式 APPROVE:管理员批准 INVITE:管理员邀请 */
|
|
290
158
|
type: 'invite' | 'approve';
|
|
291
159
|
}
|
|
292
|
-
/**
|
|
293
|
-
* - 群成员减少
|
|
294
|
-
*/
|
|
160
|
+
/** 群成员减少 */
|
|
295
161
|
export interface GroupMemberDecreaseType {
|
|
296
|
-
/**
|
|
297
|
-
* - 群ID
|
|
298
|
-
*/
|
|
162
|
+
/** 群ID */
|
|
299
163
|
group_id: string;
|
|
300
|
-
/**
|
|
301
|
-
* - 操作者uid
|
|
302
|
-
*/
|
|
164
|
+
/** 操作者uid */
|
|
303
165
|
operator_uid: string;
|
|
304
|
-
/**
|
|
305
|
-
* - 操作者uin
|
|
306
|
-
*/
|
|
166
|
+
/** 操作者uin */
|
|
307
167
|
operator_uin: string;
|
|
308
|
-
/**
|
|
309
|
-
* - 目标uid
|
|
310
|
-
*/
|
|
168
|
+
/** 目标uid */
|
|
311
169
|
target_uid: string;
|
|
312
|
-
/**
|
|
313
|
-
* - 目标uin
|
|
314
|
-
*/
|
|
170
|
+
/** 目标uin */
|
|
315
171
|
target_uin: string;
|
|
316
|
-
/**
|
|
317
|
-
* - 减少方式 leave:主动退群 kick:成员被踢 kick_me:机器人自身被踢
|
|
318
|
-
*/
|
|
172
|
+
/** 减少方式 leave:主动退群 kick:成员被踢 kick_me:机器人自身被踢 */
|
|
319
173
|
type: 'leave' | 'kick' | 'kick_me';
|
|
320
174
|
}
|
|
321
|
-
/**
|
|
322
|
-
* - 群管理员变动
|
|
323
|
-
*/
|
|
175
|
+
/** 群管理员变动 */
|
|
324
176
|
export interface GroupAdminChangedType {
|
|
325
|
-
/**
|
|
326
|
-
* - 群ID
|
|
327
|
-
*/
|
|
177
|
+
/** 群ID */
|
|
328
178
|
group_id: string;
|
|
329
|
-
/**
|
|
330
|
-
* - 目标uid
|
|
331
|
-
*/
|
|
179
|
+
/** 目标uid */
|
|
332
180
|
target_uid: string;
|
|
333
|
-
/**
|
|
334
|
-
* - 目标uin
|
|
335
|
-
*/
|
|
181
|
+
/** 目标uin */
|
|
336
182
|
target_uin: string;
|
|
337
|
-
/**
|
|
338
|
-
* - 设置、取消管理员
|
|
339
|
-
*/
|
|
183
|
+
/** 设置、取消管理员 */
|
|
340
184
|
is_admin: boolean;
|
|
341
185
|
}
|
|
342
|
-
/**
|
|
343
|
-
* - 群打卡
|
|
344
|
-
*/
|
|
186
|
+
/** 群打卡 */
|
|
345
187
|
export interface GroupSignInType {
|
|
346
|
-
/**
|
|
347
|
-
* - 群ID
|
|
348
|
-
*/
|
|
188
|
+
/** 群ID */
|
|
349
189
|
group_id: string;
|
|
350
|
-
/**
|
|
351
|
-
* - 目标uid
|
|
352
|
-
*/
|
|
190
|
+
/** 目标uid */
|
|
353
191
|
target_uid: string;
|
|
354
|
-
/**
|
|
355
|
-
* - 目标uin
|
|
356
|
-
*/
|
|
192
|
+
/** 目标uin */
|
|
357
193
|
target_uin: string;
|
|
358
|
-
/**
|
|
359
|
-
* - 操作名称,如“打卡了”
|
|
360
|
-
*/
|
|
194
|
+
/** 操作名称,如“打卡了” */
|
|
361
195
|
action: string;
|
|
362
|
-
/**
|
|
363
|
-
* - 打卡图标url
|
|
364
|
-
*/
|
|
196
|
+
/** 打卡图标url */
|
|
365
197
|
rank_image: string;
|
|
366
198
|
}
|
|
367
|
-
/**
|
|
368
|
-
* - 群成员被禁言
|
|
369
|
-
*/
|
|
199
|
+
/** 群成员被禁言 */
|
|
370
200
|
export interface GroupMemberBanType {
|
|
371
|
-
/**
|
|
372
|
-
* - 群ID
|
|
373
|
-
*/
|
|
201
|
+
/** 群ID */
|
|
374
202
|
group_id: string;
|
|
375
|
-
/**
|
|
376
|
-
* - 操作者uid
|
|
377
|
-
*/
|
|
203
|
+
/** 操作者uid */
|
|
378
204
|
operator_uid: string;
|
|
379
|
-
/**
|
|
380
|
-
* - 操作者uin
|
|
381
|
-
*/
|
|
205
|
+
/** 操作者uin */
|
|
382
206
|
operator_uin: string;
|
|
383
|
-
/**
|
|
384
|
-
* - 目标uid
|
|
385
|
-
*/
|
|
207
|
+
/** 目标uid */
|
|
386
208
|
target_uid: string;
|
|
387
|
-
/**
|
|
388
|
-
* - 目标uin
|
|
389
|
-
*/
|
|
209
|
+
/** 目标uin */
|
|
390
210
|
target_uin: string;
|
|
391
|
-
/**
|
|
392
|
-
* - 禁言时长,单位秒
|
|
393
|
-
*/
|
|
211
|
+
/** 禁言时长,单位秒 */
|
|
394
212
|
duration: number;
|
|
395
|
-
/**
|
|
396
|
-
* - 禁言类型 ban:禁言 lift_ban:解禁
|
|
397
|
-
*/
|
|
213
|
+
/** 禁言类型 ban:禁言 lift_ban:解禁 */
|
|
398
214
|
type: 'ban' | 'lift_ban';
|
|
399
215
|
}
|
|
400
|
-
/**
|
|
401
|
-
* - 群全员禁言
|
|
402
|
-
*/
|
|
216
|
+
/** 群全员禁言 */
|
|
403
217
|
export interface GroupWholeBanType {
|
|
404
|
-
/**
|
|
405
|
-
* - 群ID
|
|
406
|
-
*/
|
|
218
|
+
/** 群ID */
|
|
407
219
|
group_id: string;
|
|
408
|
-
/**
|
|
409
|
-
* - 操作者uid
|
|
410
|
-
*/
|
|
220
|
+
/** 操作者uid */
|
|
411
221
|
operator_uid: string;
|
|
412
|
-
/**
|
|
413
|
-
* - 操作者uin
|
|
414
|
-
*/
|
|
222
|
+
/** 操作者uin */
|
|
415
223
|
operator_uin: string;
|
|
416
|
-
/**
|
|
417
|
-
* - 是否开启全体禁言
|
|
418
|
-
*/
|
|
224
|
+
/** 是否开启全体禁言 */
|
|
419
225
|
is_ban: boolean;
|
|
420
226
|
}
|
|
421
|
-
/**
|
|
422
|
-
* - 群表情动态
|
|
423
|
-
*/
|
|
227
|
+
/** 群表情动态 */
|
|
424
228
|
export interface GroupMessageReactionType {
|
|
425
|
-
/**
|
|
426
|
-
* - 群ID
|
|
427
|
-
*/
|
|
229
|
+
/** 群ID */
|
|
428
230
|
group_id: string;
|
|
429
|
-
/**
|
|
430
|
-
* - 操作者uid
|
|
431
|
-
*/
|
|
231
|
+
/** 操作者uid */
|
|
432
232
|
message_id: string;
|
|
433
|
-
/**
|
|
434
|
-
* - 表情ID 参考: https://bot.q.qq.com/wiki/develop/api-v2/openapi/emoji/model.html#EmojiType
|
|
435
|
-
*/
|
|
233
|
+
/** 表情ID 参考: https://bot.q.qq.com/wiki/develop/api-v2/openapi/emoji/model.html#EmojiType */
|
|
436
234
|
face_id: number;
|
|
437
|
-
/**
|
|
438
|
-
* - 添加、取消回应
|
|
439
|
-
*/
|
|
235
|
+
/** 添加、取消回应 */
|
|
440
236
|
is_set: boolean;
|
|
441
237
|
}
|
|
442
|
-
/**
|
|
443
|
-
|
|
444
|
-
*/
|
|
238
|
+
/** 新增好友 */
|
|
239
|
+
export interface FriendIncreaseType {
|
|
240
|
+
/** 新好友uid */
|
|
241
|
+
target_uid: string;
|
|
242
|
+
/** 新好友uin */
|
|
243
|
+
target_uin: string;
|
|
244
|
+
}
|
|
245
|
+
/** 通知事件子类型 */
|
|
445
246
|
export interface NoticeType {
|
|
446
247
|
[NoticeSubType.PrivatePoke]: PrivatePokeType;
|
|
447
248
|
[NoticeSubType.PrivateRecall]: PrivateRecallType;
|
|
@@ -459,27 +260,20 @@ export interface NoticeType {
|
|
|
459
260
|
[NoticeSubType.GroupMemberBan]: GroupMemberBanType;
|
|
460
261
|
[NoticeSubType.GroupWholeBan]: GroupWholeBanType;
|
|
461
262
|
[NoticeSubType.GroupMessageReaction]: GroupMessageReactionType;
|
|
263
|
+
[NoticeSubType.FriendIncrease]: FriendIncreaseType;
|
|
462
264
|
}
|
|
463
|
-
/**
|
|
464
|
-
* - 请求事件基类
|
|
465
|
-
*/
|
|
265
|
+
/** 请求事件基类 */
|
|
466
266
|
export interface KarinNoticeEventBase extends KarinEventType {
|
|
467
267
|
event: EventType.Notice;
|
|
468
268
|
}
|
|
469
|
-
/**
|
|
470
|
-
|
|
471
|
-
*/
|
|
472
|
-
type NoticeEvent<T extends NoticeSubType> = KarinNoticeEventBase & {
|
|
269
|
+
/** 辅助类型,用于生成 KarinRequestEvent 的联合类型来自动推导content的类型 */
|
|
270
|
+
export type NoticeEvent<T extends NoticeSubType> = KarinNoticeEventBase & {
|
|
473
271
|
sub_event: T;
|
|
474
272
|
content: NoticeType[T];
|
|
475
273
|
};
|
|
476
|
-
/**
|
|
477
|
-
|
|
478
|
-
*/
|
|
479
|
-
export type KarinNoticeType = NoticeEvent<NoticeSubType.PrivatePoke> | NoticeEvent<NoticeSubType.PrivateRecall> | NoticeEvent<NoticeSubType.PrivateFileUploaded> | NoticeEvent<NoticeSubType.GroupPoke> | NoticeEvent<NoticeSubType.GroupRecall> | NoticeEvent<NoticeSubType.GroupFileUploaded> | NoticeEvent<NoticeSubType.GroupCardChanged> | NoticeEvent<NoticeSubType.GroupMemberUniqueTitleChanged> | NoticeEvent<NoticeSubType.GroupEssenceChanged> | NoticeEvent<NoticeSubType.GroupMemberIncrease> | NoticeEvent<NoticeSubType.GroupMemberDecrease> | NoticeEvent<NoticeSubType.GroupAdminChanged> | NoticeEvent<NoticeSubType.GroupSignIn> | NoticeEvent<NoticeSubType.GroupMemberBan> | NoticeEvent<NoticeSubType.GroupWholeBan> | NoticeEvent<NoticeSubType.GroupMessageReaction>;
|
|
480
|
-
/**
|
|
481
|
-
* - 创建一个通知事件
|
|
482
|
-
*/
|
|
274
|
+
/** 通知事件定义 */
|
|
275
|
+
export type KarinNoticeType = NoticeEvent<NoticeSubType.PrivatePoke> | NoticeEvent<NoticeSubType.PrivateRecall> | NoticeEvent<NoticeSubType.PrivateFileUploaded> | NoticeEvent<NoticeSubType.GroupPoke> | NoticeEvent<NoticeSubType.GroupRecall> | NoticeEvent<NoticeSubType.GroupFileUploaded> | NoticeEvent<NoticeSubType.GroupCardChanged> | NoticeEvent<NoticeSubType.GroupMemberUniqueTitleChanged> | NoticeEvent<NoticeSubType.GroupEssenceChanged> | NoticeEvent<NoticeSubType.GroupMemberIncrease> | NoticeEvent<NoticeSubType.GroupMemberDecrease> | NoticeEvent<NoticeSubType.GroupAdminChanged> | NoticeEvent<NoticeSubType.GroupSignIn> | NoticeEvent<NoticeSubType.GroupMemberBan> | NoticeEvent<NoticeSubType.GroupWholeBan> | NoticeEvent<NoticeSubType.GroupMessageReaction> | NoticeEvent<NoticeSubType.FriendIncrease>;
|
|
276
|
+
/** 创建一个通知事件 */
|
|
483
277
|
export declare class KarinNotice implements KarinNoticeEventBase {
|
|
484
278
|
self_id: KarinNoticeType['self_id'];
|
|
485
279
|
user_id: KarinNoticeType['user_id'];
|
|
@@ -505,9 +299,8 @@ export declare class KarinNotice implements KarinNoticeEventBase {
|
|
|
505
299
|
replyCallback: KarinNoticeType['replyCallback'];
|
|
506
300
|
bot: KarinNoticeType['bot'];
|
|
507
301
|
content: KarinNoticeType['content'];
|
|
508
|
-
constructor({ event_id, self_id, user_id, group_id, time, contact, sender, sub_event, content, raw_event, }: BaseEventDataType & {
|
|
302
|
+
constructor({ event_id: eventId, self_id: selfId, user_id: userId, group_id: groupId, time, contact, sender, sub_event: subEvent, content, raw_event: rawEvent, }: BaseEventDataType & {
|
|
509
303
|
sub_event: KarinNoticeType['sub_event'];
|
|
510
304
|
content: KarinNoticeType['content'];
|
|
511
305
|
});
|
|
512
306
|
}
|
|
513
|
-
export {};
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* - 创建一个通知事件
|
|
3
|
-
*/
|
|
1
|
+
/** 创建一个通知事件 */
|
|
4
2
|
export class KarinNotice {
|
|
5
3
|
self_id;
|
|
6
4
|
user_id;
|
|
@@ -26,17 +24,17 @@ export class KarinNotice {
|
|
|
26
24
|
replyCallback;
|
|
27
25
|
bot;
|
|
28
26
|
content;
|
|
29
|
-
constructor({ event_id, self_id, user_id, group_id = '', time, contact, sender, sub_event, content, raw_event, }) {
|
|
30
|
-
this.raw_event =
|
|
31
|
-
this.self_id =
|
|
32
|
-
this.user_id =
|
|
33
|
-
this.group_id = contact.scene === 'group' ? (contact.peer ||
|
|
27
|
+
constructor({ event_id: eventId, self_id: selfId, user_id: userId, group_id: groupId = '', time, contact, sender, sub_event: subEvent, content, raw_event: rawEvent, }) {
|
|
28
|
+
this.raw_event = rawEvent;
|
|
29
|
+
this.self_id = selfId;
|
|
30
|
+
this.user_id = userId;
|
|
31
|
+
this.group_id = contact.scene === 'group' ? (contact.peer || groupId) : groupId;
|
|
34
32
|
this.time = time;
|
|
35
33
|
this.event = "notice" /* EventType.Notice */;
|
|
36
|
-
this.event_id =
|
|
34
|
+
this.event_id = eventId;
|
|
37
35
|
this.contact = contact;
|
|
38
36
|
this.sender = sender;
|
|
39
|
-
this.sub_event =
|
|
37
|
+
this.sub_event = subEvent;
|
|
40
38
|
this.isMaster = false;
|
|
41
39
|
this.isAdmin = false;
|
|
42
40
|
this.isPrivate = false;
|