node-karin 0.6.18 → 0.6.20
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/index.d.ts +1 -1
- package/lib/adapter/index.js +1 -1
- package/lib/adapter/input/index.d.ts +16 -3
- package/lib/adapter/input/index.js +52 -38
- package/lib/adapter/kritor/grpc.d.ts +3 -2
- package/lib/adapter/kritor/grpc.js +80 -64
- package/lib/adapter/kritor/index.d.ts +35 -18
- package/lib/adapter/kritor/index.js +26 -10
- package/lib/adapter/onebot/11/convert.d.ts +11 -0
- package/lib/adapter/onebot/11/convert.js +168 -0
- package/lib/adapter/onebot/11/event.d.ts +25 -0
- package/lib/adapter/onebot/11/event.js +425 -0
- package/lib/adapter/onebot/11/index.d.ts +506 -0
- package/lib/adapter/onebot/11/index.js +1047 -0
- package/lib/cli/init.js +11 -0
- package/lib/core/karin.d.ts +3 -4
- package/lib/core/karin.js +3 -2
- package/lib/core/listener.d.ts +2 -2
- package/lib/core/listener.js +2 -2
- package/lib/core/plugin.app.js +2 -1
- package/lib/core/plugin.d.ts +4 -4
- package/lib/core/plugin.js +2 -1
- package/lib/core/plugin.loader.d.ts +3 -3
- package/lib/core/plugin.loader.js +2 -1
- package/lib/core/server.js +3 -3
- package/lib/event/event.handler.d.ts +5 -5
- package/lib/event/event.handler.js +6 -5
- package/lib/event/index.d.ts +0 -4
- package/lib/event/index.js +0 -4
- package/lib/event/message.handler.d.ts +3 -3
- package/lib/event/notice.handler.d.ts +3 -3
- package/lib/event/notice.handler.js +17 -16
- package/lib/event/request.handler.d.ts +3 -3
- package/lib/event/request.handler.js +4 -3
- package/lib/event/review.handler.d.ts +7 -8
- package/lib/index.js +1 -1
- package/lib/types/adapter/adapter.d.ts +564 -0
- package/lib/types/adapter/adapter.js +1 -0
- package/lib/types/{api.d.ts → adapter/api.d.ts} +103 -3
- package/lib/types/adapter/api.js +1 -0
- package/lib/types/element.d.ts +5 -4
- package/lib/types/event/contact.d.ts +28 -0
- package/lib/types/event/contact.js +13 -0
- package/lib/types/event/event.d.ts +390 -0
- package/lib/types/event/event.js +234 -0
- package/lib/types/event/index.d.ts +12 -0
- package/lib/types/event/index.js +7 -0
- package/lib/types/event/message.d.ts +104 -0
- package/lib/types/event/message.js +72 -0
- package/lib/types/event/notice.d.ts +513 -0
- package/lib/types/event/notice.js +52 -0
- package/lib/types/{reply.d.ts → event/reply.d.ts} +2 -2
- package/lib/types/event/reply.js +1 -0
- package/lib/types/event/request.d.ts +126 -0
- package/lib/types/event/request.js +52 -0
- package/lib/types/event/sender.d.ts +44 -0
- package/lib/types/event/sender.js +22 -0
- package/lib/types/index.d.ts +6 -5
- package/lib/types/index.js +6 -5
- package/lib/types/onebot11/api.d.ts +53 -0
- package/lib/types/onebot11/api.js +54 -0
- package/lib/types/onebot11/event.d.ts +619 -0
- package/lib/types/onebot11/event.js +56 -0
- package/lib/types/onebot11/index.d.ts +6 -0
- package/lib/types/onebot11/index.js +6 -0
- package/lib/types/onebot11/params.d.ts +609 -0
- package/lib/types/onebot11/params.js +7 -0
- package/lib/types/onebot11/response.d.ts +516 -0
- package/lib/types/onebot11/response.js +1 -0
- package/lib/types/onebot11/segment.d.ts +268 -0
- package/lib/types/onebot11/segment.js +30 -0
- package/lib/types/onebot11/sender.d.ts +59 -0
- package/lib/types/onebot11/sender.js +1 -0
- package/lib/types/plugin.d.ts +10 -11
- package/lib/utils/button.d.ts +2 -2
- package/lib/utils/common.d.ts +2 -2
- package/lib/utils/config.js +3 -3
- package/lib/utils/handler.d.ts +2 -2
- package/lib/utils/handler.js +1 -1
- package/lib/utils/init.d.ts +1 -1
- package/lib/utils/init.js +2 -1
- package/lib/utils/segment.d.ts +2 -2
- package/package.json +1 -1
- package/lib/adapter/onebot/onebot11.d.ts +0 -309
- package/lib/adapter/onebot/onebot11.js +0 -1285
- package/lib/event/event.d.ts +0 -140
- package/lib/event/event.js +0 -125
- package/lib/event/message.d.ts +0 -105
- package/lib/event/message.js +0 -70
- package/lib/event/notice.d.ts +0 -49
- package/lib/event/notice.js +0 -15
- package/lib/event/request.d.ts +0 -49
- package/lib/event/request.js +0 -15
- package/lib/types/adapter.d.ts +0 -581
- package/lib/types/adapter.js +0 -1
- package/lib/types/api.js +0 -1
- package/lib/types/event.d.ts +0 -789
- package/lib/types/event.js +0 -1
- package/lib/types/onebots11.d.ts +0 -1426
- package/lib/types/onebots11.js +0 -1
- package/lib/types/reply.js +0 -1
|
@@ -0,0 +1,506 @@
|
|
|
1
|
+
import WebSocket from 'ws';
|
|
2
|
+
import { IncomingMessage } from 'http';
|
|
3
|
+
import { GroupHonorInfo, KarinAdapter, LoggerLevel, OB11ApiParams, OB11ApiResponse, OB11Segment, Role } from '../../../types/index.js';
|
|
4
|
+
import { Scene, Contact, KarinElement, OB11EventAll, GroupInfo, NodeElement, EssenceMessageBody } from '../../../types/index.js';
|
|
5
|
+
/**
|
|
6
|
+
* @class OneBot11
|
|
7
|
+
* @extends KarinAdapter
|
|
8
|
+
*/
|
|
9
|
+
export declare class AdapterOneBot11 implements KarinAdapter {
|
|
10
|
+
#private;
|
|
11
|
+
/**
|
|
12
|
+
* - 重连次数 仅正向ws使用
|
|
13
|
+
*/
|
|
14
|
+
index: number;
|
|
15
|
+
socket: WebSocket;
|
|
16
|
+
account: KarinAdapter['account'];
|
|
17
|
+
adapter: KarinAdapter['adapter'];
|
|
18
|
+
version: KarinAdapter['version'];
|
|
19
|
+
constructor();
|
|
20
|
+
/**
|
|
21
|
+
* 反向ws初始化
|
|
22
|
+
*/
|
|
23
|
+
server(socket: WebSocket, request: IncomingMessage): Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* 正向ws初始化
|
|
26
|
+
* @param connect - WebSocket连接地址
|
|
27
|
+
*/
|
|
28
|
+
client(connect: string): Promise<void>;
|
|
29
|
+
init(data: OB11EventAll): boolean;
|
|
30
|
+
get self_id(): string;
|
|
31
|
+
/**
|
|
32
|
+
* 获取当前登录号信息
|
|
33
|
+
*/
|
|
34
|
+
getSelf(): Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* onebot11转karin
|
|
37
|
+
* @return karin格式消息
|
|
38
|
+
*/
|
|
39
|
+
AdapterConvertKarin(data: Array<OB11Segment>): KarinElement[];
|
|
40
|
+
/**
|
|
41
|
+
* karin转onebot11
|
|
42
|
+
* @param data karin格式消息
|
|
43
|
+
*/
|
|
44
|
+
KarinConvertAdapter(data: Array<KarinElement>): OB11Segment[];
|
|
45
|
+
/**
|
|
46
|
+
* 专属当前Bot的日志打印方法
|
|
47
|
+
*/
|
|
48
|
+
logger(level: LoggerLevel, ...args: any[]): void;
|
|
49
|
+
/**
|
|
50
|
+
* 获取头像url
|
|
51
|
+
* @param 头像大小,默认`0`
|
|
52
|
+
* @param 用户qq,默认为机器人QQ
|
|
53
|
+
* @returns 头像的url地址
|
|
54
|
+
*/
|
|
55
|
+
getAvatarUrl(uid?: string, size?: number): string;
|
|
56
|
+
/**
|
|
57
|
+
* 获取群头像
|
|
58
|
+
* @param group_id - 群号
|
|
59
|
+
* @param size - 头像大小,默认`0`
|
|
60
|
+
* @param history - 历史头像记录,默认`0`,若要获取历史群头像则填写1,2,3...
|
|
61
|
+
* @returns - 群头像的url地址
|
|
62
|
+
*/
|
|
63
|
+
getGroupAvatar(group_id: string, size?: number, history?: number): string;
|
|
64
|
+
/**
|
|
65
|
+
* 发送消息
|
|
66
|
+
*
|
|
67
|
+
* @param contact
|
|
68
|
+
* @param elements
|
|
69
|
+
* @returns - 消息ID
|
|
70
|
+
*/
|
|
71
|
+
SendMessage(contact: Contact, elements: Array<KarinElement>): Promise<{
|
|
72
|
+
message_id: string;
|
|
73
|
+
message_time: number;
|
|
74
|
+
}>;
|
|
75
|
+
/**
|
|
76
|
+
* 上传合并转发消息
|
|
77
|
+
* @param contact - 联系人信息
|
|
78
|
+
* @param elements - nodes
|
|
79
|
+
* @returns - 资源id
|
|
80
|
+
*/
|
|
81
|
+
UploadForwardMessage(contact: Contact, elements: NodeElement[]): Promise<string>;
|
|
82
|
+
/**
|
|
83
|
+
* 通过资源id发送转发消息
|
|
84
|
+
* @param contact - 联系人信息
|
|
85
|
+
* @param id - 资源id
|
|
86
|
+
*/
|
|
87
|
+
SendMessageByResId(contact: Contact, id: string): Promise<{
|
|
88
|
+
message_id: string;
|
|
89
|
+
message_time: number;
|
|
90
|
+
}>;
|
|
91
|
+
/**
|
|
92
|
+
* 撤回消息
|
|
93
|
+
* @param _contact - ob11无需提供contact参数
|
|
94
|
+
* @param message_id - 消息ID
|
|
95
|
+
*/
|
|
96
|
+
RecallMessage(_contact: Contact, message_id: string): Promise<boolean>;
|
|
97
|
+
/**
|
|
98
|
+
* 获取消息
|
|
99
|
+
* @param contact - 联系人信息
|
|
100
|
+
* @param message_id - 消息ID
|
|
101
|
+
*/
|
|
102
|
+
GetMessage(contact: Contact, message_id: string): Promise<{
|
|
103
|
+
time: number;
|
|
104
|
+
message_id: string;
|
|
105
|
+
message_seq: number;
|
|
106
|
+
contact: {
|
|
107
|
+
scene: Scene;
|
|
108
|
+
peer: string;
|
|
109
|
+
};
|
|
110
|
+
sender: {
|
|
111
|
+
uid: string;
|
|
112
|
+
uin: string;
|
|
113
|
+
nick: string;
|
|
114
|
+
role: Role;
|
|
115
|
+
};
|
|
116
|
+
elements: KarinElement[];
|
|
117
|
+
}>;
|
|
118
|
+
/**
|
|
119
|
+
* 获取msg_id获取历史消息
|
|
120
|
+
* @description 此api各平台实现不同
|
|
121
|
+
*/
|
|
122
|
+
GetHistoryMessage(contact: Contact, start_message_id: string, count?: number): Promise<{
|
|
123
|
+
time: number;
|
|
124
|
+
message_id: string;
|
|
125
|
+
message_seq: number;
|
|
126
|
+
contact: {
|
|
127
|
+
scene: Scene;
|
|
128
|
+
peer: string;
|
|
129
|
+
sub_peer: string;
|
|
130
|
+
};
|
|
131
|
+
sender: {
|
|
132
|
+
uid: string;
|
|
133
|
+
uin: string;
|
|
134
|
+
nick: string;
|
|
135
|
+
role: Role;
|
|
136
|
+
};
|
|
137
|
+
elements: KarinElement[];
|
|
138
|
+
}[]>;
|
|
139
|
+
/**
|
|
140
|
+
* 发送好友赞
|
|
141
|
+
* @param target_uid_or_uin - 用户ID
|
|
142
|
+
* @param vote_count - 赞的次数,默认为`10`
|
|
143
|
+
*/
|
|
144
|
+
VoteUser(target_uid_or_uin: string, vote_count?: number): Promise<boolean>;
|
|
145
|
+
/**
|
|
146
|
+
* 群组踢人
|
|
147
|
+
*/
|
|
148
|
+
KickMember(group_id: string, target_uid_or_uin: string, reject_add_request?: boolean, kick_reason?: string): Promise<boolean>;
|
|
149
|
+
/**
|
|
150
|
+
* 禁言用户
|
|
151
|
+
* @param group_id - 群号
|
|
152
|
+
* @param target_uid_or_uin - 用户ID
|
|
153
|
+
* @param duration - 禁言时长,单位秒,0 表示取消禁言
|
|
154
|
+
*/
|
|
155
|
+
BanMember(group_id: string, target_uid_or_uin: string, duration: number): Promise<boolean>;
|
|
156
|
+
/**
|
|
157
|
+
* 群组全员禁言
|
|
158
|
+
* @param group_id - 群号
|
|
159
|
+
* @param is_ban - 是否全员禁言
|
|
160
|
+
*/
|
|
161
|
+
SetGroupWholeBan(group_id: string, is_ban?: boolean): Promise<boolean>;
|
|
162
|
+
/**
|
|
163
|
+
* 设置群管理员
|
|
164
|
+
* @param group_id - 群号
|
|
165
|
+
* @param target_uid_or_uin - 目标用户ID
|
|
166
|
+
* @param is_admin - 是否设置为管理员
|
|
167
|
+
*/
|
|
168
|
+
SetGroupAdmin(group_id: string, target_uid_or_uin: string, is_admin: boolean): Promise<boolean>;
|
|
169
|
+
/**
|
|
170
|
+
* 修改群名片
|
|
171
|
+
* @param group_id - 群号
|
|
172
|
+
* @param target_uid_or_uin - 目标用户ID
|
|
173
|
+
* @param card - 新名片
|
|
174
|
+
*/
|
|
175
|
+
ModifyMemberCard(group_id: string, target_uid_or_uin: string, card: string): Promise<boolean>;
|
|
176
|
+
/**
|
|
177
|
+
* 设置群名
|
|
178
|
+
* @param group_id - 群号
|
|
179
|
+
* @param group_name - 新群名
|
|
180
|
+
*/
|
|
181
|
+
ModifyGroupName(group_id: string, group_name: string): Promise<boolean>;
|
|
182
|
+
/**
|
|
183
|
+
* 退出群组
|
|
184
|
+
* @param group_id - 群号
|
|
185
|
+
* @param is_dismiss - 是否解散,如果登录号是群主,则仅在此项为 true 时能够解散
|
|
186
|
+
*/
|
|
187
|
+
LeaveGroup(group_id: string, is_dismiss?: boolean): Promise<false | undefined>;
|
|
188
|
+
/**
|
|
189
|
+
* 设置群专属头衔
|
|
190
|
+
* @param group_id - 群号
|
|
191
|
+
* @param target_uid_or_uin - 目标用户ID
|
|
192
|
+
* @param special_title - 专属头衔
|
|
193
|
+
*/
|
|
194
|
+
SetGroupUniqueTitle(group_id: string, target_uid_or_uin: string, unique_title: string): Promise<false | undefined>;
|
|
195
|
+
/**
|
|
196
|
+
* 获取登录号信息
|
|
197
|
+
*/
|
|
198
|
+
GetCurrentAccount(): Promise<{
|
|
199
|
+
account_uid: string;
|
|
200
|
+
account_uin: string;
|
|
201
|
+
account_name: string;
|
|
202
|
+
}>;
|
|
203
|
+
/**
|
|
204
|
+
* 获取陌生人信息 不支持批量获取 只支持一个
|
|
205
|
+
* @param target_uid_or_uin - 目标用户ID
|
|
206
|
+
*/
|
|
207
|
+
GetStrangerProfileCard(target_uid_or_uin: Array<string>): Promise<{
|
|
208
|
+
/**
|
|
209
|
+
* - 用户UID
|
|
210
|
+
*/
|
|
211
|
+
uid: string;
|
|
212
|
+
/**
|
|
213
|
+
* - 用户UIN
|
|
214
|
+
*/
|
|
215
|
+
uin: string;
|
|
216
|
+
/**
|
|
217
|
+
* - qid
|
|
218
|
+
*/
|
|
219
|
+
qid: string;
|
|
220
|
+
/**
|
|
221
|
+
* - 名称
|
|
222
|
+
*/
|
|
223
|
+
nick: string;
|
|
224
|
+
/**
|
|
225
|
+
* - 备注
|
|
226
|
+
*/
|
|
227
|
+
remark: string;
|
|
228
|
+
/**
|
|
229
|
+
* - 用户等级
|
|
230
|
+
*/
|
|
231
|
+
level: number;
|
|
232
|
+
/**
|
|
233
|
+
* - 生日
|
|
234
|
+
*/
|
|
235
|
+
birthday: string;
|
|
236
|
+
/**
|
|
237
|
+
* - 登录天数
|
|
238
|
+
*/
|
|
239
|
+
login_day: number;
|
|
240
|
+
/**
|
|
241
|
+
* - 点赞数
|
|
242
|
+
*/
|
|
243
|
+
vote_cnt: number;
|
|
244
|
+
/**
|
|
245
|
+
* - 学校是否已核实
|
|
246
|
+
*/
|
|
247
|
+
is_school_verified: undefined;
|
|
248
|
+
/**
|
|
249
|
+
* - 年龄
|
|
250
|
+
* - 拓展字段
|
|
251
|
+
*/
|
|
252
|
+
age: number;
|
|
253
|
+
/**
|
|
254
|
+
* - 性别
|
|
255
|
+
* - 拓展字段
|
|
256
|
+
*/
|
|
257
|
+
sex: "unknown" | "male" | "female";
|
|
258
|
+
ext: {
|
|
259
|
+
/**
|
|
260
|
+
* 大会员
|
|
261
|
+
*/
|
|
262
|
+
big_vip: undefined;
|
|
263
|
+
/**
|
|
264
|
+
* 好莱坞/腾讯视频会员
|
|
265
|
+
*/
|
|
266
|
+
hollywood_vip: undefined;
|
|
267
|
+
/**
|
|
268
|
+
* QQ会员
|
|
269
|
+
*/
|
|
270
|
+
qq_vip: undefined;
|
|
271
|
+
/**
|
|
272
|
+
* QQ超级会员
|
|
273
|
+
*/
|
|
274
|
+
super_vip: undefined;
|
|
275
|
+
/**
|
|
276
|
+
* 是否已经赞过
|
|
277
|
+
*/
|
|
278
|
+
voted: undefined;
|
|
279
|
+
};
|
|
280
|
+
}[]>;
|
|
281
|
+
/**
|
|
282
|
+
* 获取好友列表
|
|
283
|
+
*/
|
|
284
|
+
GetFriendList(): Promise<{
|
|
285
|
+
/**
|
|
286
|
+
* - 用户UID
|
|
287
|
+
*/
|
|
288
|
+
uid: string;
|
|
289
|
+
/**
|
|
290
|
+
* - 用户UIN
|
|
291
|
+
*/
|
|
292
|
+
uin: string;
|
|
293
|
+
/**
|
|
294
|
+
* - qid
|
|
295
|
+
*/
|
|
296
|
+
qid: string;
|
|
297
|
+
/**
|
|
298
|
+
* - 名称
|
|
299
|
+
*/
|
|
300
|
+
nick: string;
|
|
301
|
+
/**
|
|
302
|
+
* - 备注
|
|
303
|
+
*/
|
|
304
|
+
remark: string;
|
|
305
|
+
/**
|
|
306
|
+
* - 用户等级
|
|
307
|
+
*/
|
|
308
|
+
level: number;
|
|
309
|
+
/**
|
|
310
|
+
* - 生日
|
|
311
|
+
*/
|
|
312
|
+
birthday: string;
|
|
313
|
+
/**
|
|
314
|
+
* - 登录天数
|
|
315
|
+
*/
|
|
316
|
+
login_day: number;
|
|
317
|
+
/**
|
|
318
|
+
* - 点赞数
|
|
319
|
+
*/
|
|
320
|
+
vote_cnt: number;
|
|
321
|
+
/**
|
|
322
|
+
* - 学校是否已核实
|
|
323
|
+
*/
|
|
324
|
+
is_school_verified: undefined;
|
|
325
|
+
/**
|
|
326
|
+
* - 年龄
|
|
327
|
+
* - 拓展字段
|
|
328
|
+
*/
|
|
329
|
+
age: number;
|
|
330
|
+
/**
|
|
331
|
+
* - 性别
|
|
332
|
+
* - 拓展字段
|
|
333
|
+
*/
|
|
334
|
+
sex: "unknown" | "male" | "female";
|
|
335
|
+
ext: {
|
|
336
|
+
/**
|
|
337
|
+
* 大会员
|
|
338
|
+
*/
|
|
339
|
+
big_vip: undefined;
|
|
340
|
+
/**
|
|
341
|
+
* 好莱坞/腾讯视频会员
|
|
342
|
+
*/
|
|
343
|
+
hollywood_vip: undefined;
|
|
344
|
+
/**
|
|
345
|
+
* QQ会员
|
|
346
|
+
*/
|
|
347
|
+
qq_vip: undefined;
|
|
348
|
+
/**
|
|
349
|
+
* QQ超级会员
|
|
350
|
+
*/
|
|
351
|
+
super_vip: undefined;
|
|
352
|
+
/**
|
|
353
|
+
* 是否已经赞过
|
|
354
|
+
*/
|
|
355
|
+
voted: undefined;
|
|
356
|
+
};
|
|
357
|
+
}[]>;
|
|
358
|
+
/**
|
|
359
|
+
* 获取群信息
|
|
360
|
+
* @param group_id - 群号
|
|
361
|
+
* @param no_cache - 是否不使用缓存
|
|
362
|
+
*/
|
|
363
|
+
GetGroupInfo(group_id: string, no_cache?: boolean): Promise<GroupInfo>;
|
|
364
|
+
/**
|
|
365
|
+
* 获取群列表
|
|
366
|
+
*/
|
|
367
|
+
GetGroupList(): Promise<{
|
|
368
|
+
group_id: string;
|
|
369
|
+
group_name: string;
|
|
370
|
+
group_remark: string;
|
|
371
|
+
max_member_count: number;
|
|
372
|
+
member_count: number;
|
|
373
|
+
group_uin: string;
|
|
374
|
+
admins: never[];
|
|
375
|
+
owner: string;
|
|
376
|
+
}[]>;
|
|
377
|
+
/**
|
|
378
|
+
* 获取群成员信息
|
|
379
|
+
* @param group_id - 群号
|
|
380
|
+
* @param target_uid_or_uin - 目标用户ID
|
|
381
|
+
* @param refresh - 是否刷新缓存,默认为 false
|
|
382
|
+
*/
|
|
383
|
+
GetGroupMemberInfo(group_id: string, target_uid_or_uin: string, refresh?: boolean): Promise<{
|
|
384
|
+
uid: string;
|
|
385
|
+
uin: string;
|
|
386
|
+
nick: string;
|
|
387
|
+
age: number;
|
|
388
|
+
unique_title: string;
|
|
389
|
+
unique_title_expire_time: number;
|
|
390
|
+
card: string;
|
|
391
|
+
join_time: number;
|
|
392
|
+
last_active_time: number;
|
|
393
|
+
level: number;
|
|
394
|
+
shut_up_time: number;
|
|
395
|
+
distance: undefined;
|
|
396
|
+
honors: never[];
|
|
397
|
+
unfriendly: boolean;
|
|
398
|
+
card_changeable: boolean;
|
|
399
|
+
}>;
|
|
400
|
+
/**
|
|
401
|
+
* 获取群成员列表
|
|
402
|
+
* @param group_id - 群号
|
|
403
|
+
* @param refresh - 是否刷新缓存,默认为 false
|
|
404
|
+
*/
|
|
405
|
+
GetGroupMemberList(group_id: string, refresh?: boolean): Promise<{
|
|
406
|
+
uid: string;
|
|
407
|
+
uin: string;
|
|
408
|
+
nick: string;
|
|
409
|
+
age: number;
|
|
410
|
+
unique_title: string;
|
|
411
|
+
unique_title_expire_time: number;
|
|
412
|
+
card: string;
|
|
413
|
+
join_time: number;
|
|
414
|
+
last_active_time: number;
|
|
415
|
+
level: number;
|
|
416
|
+
shut_up_time: number;
|
|
417
|
+
distance: undefined;
|
|
418
|
+
honors: never[];
|
|
419
|
+
unfriendly: boolean;
|
|
420
|
+
card_changeable: boolean;
|
|
421
|
+
}[]>;
|
|
422
|
+
/**
|
|
423
|
+
* 获取群荣誉信息
|
|
424
|
+
*/
|
|
425
|
+
GetGroupHonor(group_id: string, refresh?: boolean): Promise<GroupHonorInfo[]>;
|
|
426
|
+
/**
|
|
427
|
+
* 对消息进行表情回应
|
|
428
|
+
* @param contact - 联系人信息
|
|
429
|
+
* @param message_id - 消息ID
|
|
430
|
+
* @param face_id - 表情ID
|
|
431
|
+
*/
|
|
432
|
+
ReactMessageWithEmoji(contact: Contact, message_id: string, face_id: number, is_set?: boolean): Promise<boolean>;
|
|
433
|
+
/**
|
|
434
|
+
* 获取版本信息
|
|
435
|
+
*/
|
|
436
|
+
GetVersion(): Promise<{
|
|
437
|
+
name: string;
|
|
438
|
+
app_name: string;
|
|
439
|
+
version: string;
|
|
440
|
+
protocol: string;
|
|
441
|
+
}>;
|
|
442
|
+
DownloadForwardMessage(res_id: string): Promise<any>;
|
|
443
|
+
/**
|
|
444
|
+
* 精华消息
|
|
445
|
+
*/
|
|
446
|
+
GetEssenceMessageList(group_id: string, page: number, page_size: number): Promise<EssenceMessageBody[]>;
|
|
447
|
+
/**
|
|
448
|
+
* 上传群文件
|
|
449
|
+
* @param group_id - 群号
|
|
450
|
+
* @param file - 本地文件绝对路径
|
|
451
|
+
* @param name - 文件名称 必须提供
|
|
452
|
+
* @param folder - 父目录ID 不提供则上传到根目录
|
|
453
|
+
*/
|
|
454
|
+
UploadGroupFile(group_id: string, file: string, name: string, folder?: string): Promise<boolean>;
|
|
455
|
+
/**
|
|
456
|
+
* 上传私聊文件
|
|
457
|
+
* @param user_id - 用户ID
|
|
458
|
+
* @param file - 本地文件绝对路径
|
|
459
|
+
* @param name - 文件名称 必须提供
|
|
460
|
+
*/
|
|
461
|
+
UploadPrivateFile(user_id: string, file: string, name: string): Promise<boolean>;
|
|
462
|
+
/**
|
|
463
|
+
* 设置精华消息
|
|
464
|
+
* @param _group_id - 群号
|
|
465
|
+
* @param message_id - 消息ID
|
|
466
|
+
*/
|
|
467
|
+
SetEssenceMessage(_group_id: string, message_id: string): Promise<boolean>;
|
|
468
|
+
/**
|
|
469
|
+
* 移除精华消息
|
|
470
|
+
* @param _group_id - 群号
|
|
471
|
+
* @param message_id - 消息ID
|
|
472
|
+
*/
|
|
473
|
+
DeleteEssenceMessage(_group_id: string, message_id: string): Promise<boolean>;
|
|
474
|
+
PokeMember(group_id: string, target_uid_or_uin: string): Promise<void>;
|
|
475
|
+
SetFriendApplyResult(request_id: string, is_approve: boolean, remark?: string): Promise<boolean>;
|
|
476
|
+
SetGroupApplyResult(request_id: string, is_approve: boolean, deny_reason?: string): Promise<boolean>;
|
|
477
|
+
SetInvitedJoinGroupResult(request_id: string, is_approve: boolean, deny_reason?: string): Promise<boolean>;
|
|
478
|
+
DownloadFile(): Promise<any>;
|
|
479
|
+
CreateFolder(): Promise<any>;
|
|
480
|
+
RenameFolder(): Promise<any>;
|
|
481
|
+
DeleteFolder(): Promise<any>;
|
|
482
|
+
DeleteFile(): Promise<any>;
|
|
483
|
+
GetFileList(): Promise<any>;
|
|
484
|
+
UploadFile(): Promise<any>;
|
|
485
|
+
GetFileSystemInfo(): Promise<any>;
|
|
486
|
+
ModifyGroupRemark(): Promise<any>;
|
|
487
|
+
GetRemainCountAtAll(): Promise<any>;
|
|
488
|
+
GetProhibitedUserList(): Promise<any>;
|
|
489
|
+
SetMessageReaded(): Promise<any>;
|
|
490
|
+
sendForwardMessage(contact: Contact, elements: NodeElement[]): Promise<{
|
|
491
|
+
message_id: string;
|
|
492
|
+
}>;
|
|
493
|
+
/**
|
|
494
|
+
* 发送API请求
|
|
495
|
+
* @param action - API断点
|
|
496
|
+
* @param {object} params - API参数
|
|
497
|
+
* @returns {Promise<any>} - API返回
|
|
498
|
+
*/
|
|
499
|
+
SendApi<T extends keyof OB11ApiParams>(action: T, params?: OB11ApiParams[T], time?: number): Promise<OB11ApiResponse[T]>;
|
|
500
|
+
}
|
|
501
|
+
declare const _default: {
|
|
502
|
+
type: string;
|
|
503
|
+
path: string;
|
|
504
|
+
adapter: typeof AdapterOneBot11;
|
|
505
|
+
};
|
|
506
|
+
export default _default;
|