node-karin 1.10.12 → 1.10.13

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # 更新日志
2
2
 
3
+ ## [1.10.13](https://github.com/KarinJS/Karin/compare/core-v1.10.12...core-v1.10.13) (2025-06-30)
4
+
5
+
6
+ ### 🐛 Bug Fixes
7
+
8
+ * close [#429](https://github.com/KarinJS/Karin/issues/429) ([bf28049](https://github.com/KarinJS/Karin/commit/bf280492827eb9c1f4208b9179f40998a9094012))
9
+
10
+
11
+ ### 📦️ Build System
12
+
13
+ * fix types error ([05feb59](https://github.com/KarinJS/Karin/commit/05feb59aad90ebff0f31e4f0440f7a9dddf241fc))
14
+
3
15
  ## [1.10.12](https://github.com/KarinJS/Karin/compare/core-v1.10.11...core-v1.10.12) (2025-06-28)
4
16
 
5
17
 
package/dist/index.d.ts CHANGED
@@ -1191,9 +1191,8 @@ interface AdapterType<T = any> {
1191
1191
  * 撤回消息
1192
1192
  * @param contact 目标信息
1193
1193
  * @param messageId 消息ID
1194
- * @returns 此接口的返回值不值得信任
1195
1194
  */
1196
- recallMsg(contact: Contact, messageId: string): Promise<boolean>;
1195
+ recallMsg(contact: Contact, messageId: string): Promise<void>;
1197
1196
  /**
1198
1197
  * 获取头像url
1199
1198
  * @param userId 用户ID
@@ -1266,76 +1265,67 @@ interface AdapterType<T = any> {
1266
1265
  * @param messageId 群消息ID
1267
1266
  * @param create true为添加精华消息,false为删除精华消息 默认为true
1268
1267
  */
1269
- setGgroupHighlights(groupId: string, messageId: string, create: boolean): Promise<boolean>;
1268
+ setGroupHighlights(groupId: string, messageId: string, create: boolean): Promise<void>;
1270
1269
  /**
1271
1270
  * 发送好友赞
1272
1271
  * @param targetId 目标ID
1273
1272
  * @param count 赞的次数,默认为10
1274
- * @returns 此接口的返回值不值得信任
1275
1273
  */
1276
- sendLike(targetId: string, count: number): Promise<boolean>;
1274
+ sendLike(targetId: string, count: number): Promise<void>;
1277
1275
  /**
1278
1276
  * 群踢人
1279
1277
  * @param groupId 群ID
1280
1278
  * @param targetId 被踢出目标的ID 任选其一
1281
1279
  * @param rejectAddRequest 是否拒绝再次申请,默认为false
1282
1280
  * @param kickReason 踢出原因,可选
1283
- * @returns 此接口的返回值不值得信任
1284
1281
  */
1285
- groupKickMember(groupId: string, targetId: string, rejectAddRequest?: boolean, kickReason?: string): Promise<boolean>;
1282
+ groupKickMember(groupId: string, targetId: string, rejectAddRequest?: boolean, kickReason?: string): Promise<void>;
1286
1283
  /**
1287
1284
  * 禁言群成员
1288
1285
  * @param groupId 群ID
1289
1286
  * @param targetId 被禁言目标的ID 任选其一
1290
1287
  * @param duration 禁言时长 单位:秒
1291
- * @returns 此接口的返回值不值得信任
1292
1288
  */
1293
- setGroupMute(groupId: string, targetId: string, duration: number): Promise<boolean>;
1289
+ setGroupMute(groupId: string, targetId: string, duration: number): Promise<void>;
1294
1290
  /**
1295
1291
  * 群全员禁言
1296
1292
  * @param groupId 群ID
1297
1293
  * @param isBan 是否开启全员禁言
1298
- * @returns 此接口的返回值不值得信任
1299
1294
  */
1300
- setGroupAllMute(groupId: string, isBan: boolean): Promise<boolean>;
1295
+ setGroupAllMute(groupId: string, isBan: boolean): Promise<void>;
1301
1296
  /**
1302
1297
  * 设置群管理员
1303
1298
  * @param groupId 群ID
1304
1299
  * @param targetId 目标用户的ID
1305
1300
  * @param isAdmin 是否设置为管理员
1306
- * @returns 此接口的返回值不值得信任
1307
1301
  */
1308
- setGroupAdmin(groupId: string, targetId: string, isAdmin: boolean): Promise<boolean>;
1302
+ setGroupAdmin(groupId: string, targetId: string, isAdmin: boolean): Promise<void>;
1309
1303
  /**
1310
1304
  * 设置群名片
1311
1305
  * @param groupId 群ID
1312
1306
  * @param targetId 目标用户的ID
1313
1307
  * @param card 新的群名片
1314
- * @returns 此接口的返回值不值得信任
1315
1308
  */
1316
- setGroupMemberCard(groupId: string, targetId: string, card: string): Promise<boolean>;
1309
+ setGroupMemberCard(groupId: string, targetId: string, card: string): Promise<void>;
1317
1310
  /**
1318
1311
  * 设置群名
1319
1312
  * @param groupId 群ID
1320
1313
  * @param groupName 新的群名
1321
- * @returns 此接口的返回值不值得信任
1322
1314
  */
1323
- setGroupName(groupId: string, groupName: string): Promise<boolean>;
1315
+ setGroupName(groupId: string, groupName: string): Promise<void>;
1324
1316
  /**
1325
1317
  * 退出群组
1326
1318
  * @param groupId 群ID
1327
1319
  * @param isDismiss 如果Bot是群主,是否解散群
1328
- * @returns 此接口的返回值不值得信任
1329
1320
  */
1330
- setGroupQuit(groupId: string, isDismiss: boolean): Promise<boolean>;
1321
+ setGroupQuit(groupId: string, isDismiss: boolean): Promise<void>;
1331
1322
  /**
1332
1323
  * 设置群专属头衔 仅群主可用
1333
1324
  * @param groupId 群ID
1334
1325
  * @param targetId 目标用户的ID
1335
1326
  * @param title 新的专属头衔
1336
- * @returns 此接口的返回值不值得信任
1337
1327
  */
1338
- setGroupMemberTitle(groupId: string, targetId: string, title: string): Promise<boolean>;
1328
+ setGroupMemberTitle(groupId: string, targetId: string, title: string): Promise<void>;
1339
1329
  /**
1340
1330
  * 获取陌生人信息
1341
1331
  * @param targetId 用户ID 任选其一
@@ -1390,39 +1380,35 @@ interface AdapterType<T = any> {
1390
1380
  * @param remark 好友备注 同意时有效
1391
1381
  * @returns 设置结果
1392
1382
  */
1393
- setFriendApplyResult(requestId: string, isApprove: boolean, remark?: string): Promise<boolean>;
1383
+ setFriendApplyResult(requestId: string, isApprove: boolean, remark?: string): Promise<void>;
1394
1384
  /**
1395
1385
  * 设置申请加入群请求结果
1396
1386
  * @param requestId 请求事件ID
1397
1387
  * @param isApprove 是否同意
1398
1388
  * @param denyReason 拒绝理由 拒绝时有效
1399
- * @returns 此接口的返回值不值得信任
1400
1389
  */
1401
- setGroupApplyResult(requestId: string, isApprove: boolean, denyReason?: string): Promise<boolean>;
1390
+ setGroupApplyResult(requestId: string, isApprove: boolean, denyReason?: string): Promise<void>;
1402
1391
  /**
1403
1392
  * 设置邀请加入群请求结果
1404
1393
  * @param requestId 请求事件ID
1405
1394
  * @param isApprove 是否同意
1406
- * @returns 此接口的返回值不值得信任
1407
1395
  */
1408
- setInvitedJoinGroupResult(requestId: string, isApprove: boolean): Promise<boolean>;
1396
+ setInvitedJoinGroupResult(requestId: string, isApprove: boolean): Promise<void>;
1409
1397
  /**
1410
1398
  * 设置消息表情回应
1411
1399
  * @param contact 目标信息
1412
1400
  * @param messageId 消息ID
1413
1401
  * @param faceId 表情ID
1414
- * @returns 此接口的返回值不值得信任
1415
1402
  */
1416
- setMsgReaction(contact: Contact, messageId: string, faceId: number, isSet: boolean): Promise<boolean>;
1403
+ setMsgReaction(contact: Contact, messageId: string, faceId: number, isSet: boolean): Promise<void>;
1417
1404
  /**
1418
1405
  * 上传群文件、私聊文件
1419
1406
  * @param contact 目标信息
1420
1407
  * @param file 本地文件绝对路径
1421
1408
  * @param name 文件名称 必须提供
1422
1409
  * @param folder 父目录ID 不提供则上传到根目录 仅在群聊时有效
1423
- * @returns 此接口的返回值不值得信任
1424
1410
  */
1425
- uploadFile(contact: Contact, file: string, name: string, folder?: string): Promise<boolean>;
1411
+ uploadFile(contact: Contact, file: string, name: string, folder?: string): Promise<void>;
1426
1412
  /**
1427
1413
  * 让协议端下载文件到协议端本地
1428
1414
  * @param options 下载文件的选项
@@ -1492,7 +1478,6 @@ interface AdapterType<T = any> {
1492
1478
  * 设置群备注
1493
1479
  * @param groupId 群号
1494
1480
  * @param remark 新的备注
1495
- * @returns 此接口的返回值不值得信任
1496
1481
  */
1497
1482
  setGroupRemark(groupId: string, remark: string): Promise<boolean>;
1498
1483
  /**
@@ -1516,7 +1501,6 @@ interface AdapterType<T = any> {
1516
1501
  * 戳一戳用户 支持群聊和私聊
1517
1502
  * @param contact 目标信息
1518
1503
  * @param count 戳一戳次数 默认为1
1519
- * @returns 此接口的返回值不值得信任
1520
1504
  */
1521
1505
  pokeUser(contact: Contact, count?: number): Promise<boolean>;
1522
1506
  /**
@@ -1545,7 +1529,7 @@ interface AdapterType<T = any> {
1545
1529
  * @param file base64:// file:// http(s)://
1546
1530
  * @returns 是否设置成功
1547
1531
  */
1548
- setAvatar(file: string): Promise<boolean>;
1532
+ setAvatar(file: string): Promise<void>;
1549
1533
  /**
1550
1534
  * 获取群 Ai 语音可用声色列表
1551
1535
  * @returns 声色列表
@@ -3148,9 +3132,8 @@ declare abstract class AdapterBase<T = any> implements AdapterType<T> {
3148
3132
  * 撤回消息
3149
3133
  * @param _contact 目标信息
3150
3134
  * @param _messageId 消息ID
3151
- * @returns 此接口的返回值不值得信任
3152
3135
  */
3153
- recallMsg(_contact: Contact, _messageId: string): Promise<boolean>;
3136
+ recallMsg(_contact: Contact, _messageId: string): Promise<void>;
3154
3137
  /**
3155
3138
  * 获取头像url
3156
3139
  * @param _userId 用户ID
@@ -3216,76 +3199,67 @@ declare abstract class AdapterBase<T = any> implements AdapterType<T> {
3216
3199
  * @param _messageId 群消息ID
3217
3200
  * @param _create true为添加精华消息,false为删除精华消息 默认为true
3218
3201
  */
3219
- setGgroupHighlights(_groupId: string, _messageId: string, _create: boolean): Promise<boolean>;
3202
+ setGroupHighlights(_groupId: string, _messageId: string, _create: boolean): Promise<void>;
3220
3203
  /**
3221
3204
  * 发送好友赞
3222
3205
  * @param _targetId 目标ID
3223
3206
  * @param _count 赞的次数
3224
- * @returns 此接口的返回值不值得信任
3225
3207
  */
3226
- sendLike(_targetId: string, _count: number): Promise<boolean>;
3208
+ sendLike(_targetId: string, _count: number): Promise<void>;
3227
3209
  /**
3228
3210
  * 群踢人
3229
3211
  * @param _groupId 群ID
3230
3212
  * @param _targetId 被踢出目标的ID 任选其一
3231
3213
  * @param _rejectAddRequest 是否拒绝再次申请,默认为false
3232
3214
  * @param _kickReason 踢出原因,可选
3233
- * @returns 此接口的返回值不值得信任
3234
3215
  */
3235
- groupKickMember(_groupId: string, _targetId: string, _rejectAddRequest?: boolean, _kickReason?: string): Promise<boolean>;
3216
+ groupKickMember(_groupId: string, _targetId: string, _rejectAddRequest?: boolean, _kickReason?: string): Promise<void>;
3236
3217
  /**
3237
3218
  * 禁言群成员
3238
3219
  * @param _groupId 群ID
3239
3220
  * @param _targetId 被禁言目标的ID 任选其一
3240
3221
  * @param _duration 禁言时长 单位:秒
3241
- * @returns 此接口的返回值不值得信任
3242
3222
  */
3243
- setGroupMute(_groupId: string, _targetId: string, _duration: number): Promise<boolean>;
3223
+ setGroupMute(_groupId: string, _targetId: string, _duration: number): Promise<void>;
3244
3224
  /**
3245
3225
  * 群全员禁言
3246
3226
  * @param _groupId 群ID
3247
3227
  * @param _isBan 是否开启全员禁言
3248
- * @returns 此接口的返回值不值得信任
3249
3228
  */
3250
- setGroupAllMute(_groupId: string, _isBan: boolean): Promise<boolean>;
3229
+ setGroupAllMute(_groupId: string, _isBan: boolean): Promise<void>;
3251
3230
  /**
3252
3231
  * 设置群管理员
3253
3232
  * @param _groupId 群ID
3254
3233
  * @param _targetId 目标用户的ID
3255
3234
  * @param _isAdmin 是否设置为管理员
3256
- * @returns 此接口的返回值不值得信任
3257
3235
  */
3258
- setGroupAdmin(_groupId: string, _targetId: string, _isAdmin: boolean): Promise<boolean>;
3236
+ setGroupAdmin(_groupId: string, _targetId: string, _isAdmin: boolean): Promise<void>;
3259
3237
  /**
3260
3238
  * 设置群名片
3261
3239
  * @param _groupId 群ID
3262
3240
  * @param _targetId 目标用户的ID
3263
3241
  * @param _card 新的群名片
3264
- * @returns 此接口的返回值不值得信任
3265
3242
  */
3266
- setGroupMemberCard(_groupId: string, _targetId: string, _card: string): Promise<boolean>;
3243
+ setGroupMemberCard(_groupId: string, _targetId: string, _card: string): Promise<void>;
3267
3244
  /**
3268
3245
  * 设置群名
3269
3246
  * @param _groupId 群ID
3270
3247
  * @param _groupName 新的群名
3271
- * @returns 此接口的返回值不值得信任
3272
3248
  */
3273
- setGroupName(_groupId: string, _groupName: string): Promise<boolean>;
3249
+ setGroupName(_groupId: string, _groupName: string): Promise<void>;
3274
3250
  /**
3275
3251
  * 退出群组
3276
3252
  * @param _groupId 群ID
3277
3253
  * @param _isDismiss 如果Bot是群主,是否解散群
3278
- * @returns 此接口的返回值不值得信任
3279
3254
  */
3280
- setGroupQuit(_groupId: string, _isDismiss: boolean): Promise<boolean>;
3255
+ setGroupQuit(_groupId: string, _isDismiss: boolean): Promise<void>;
3281
3256
  /**
3282
3257
  * 设置群专属头衔 仅群主可用
3283
3258
  * @param _groupId 群ID
3284
3259
  * @param _targetId 目标用户的ID
3285
3260
  * @param _title 新的专属头衔
3286
- * @returns 此接口的返回值不值得信任
3287
3261
  */
3288
- setGroupMemberTitle(_groupId: string, _targetId: string, _title: string): Promise<boolean>;
3262
+ setGroupMemberTitle(_groupId: string, _targetId: string, _title: string): Promise<void>;
3289
3263
  /**
3290
3264
  * 获取陌生人信息 此接口数据无法保证完全正确并且无法保证数据的完整性
3291
3265
  * @param _targetId 用户ID 任选其一
@@ -3339,41 +3313,36 @@ declare abstract class AdapterBase<T = any> implements AdapterType<T> {
3339
3313
  * @param _requestId 请求事件ID
3340
3314
  * @param _isApprove 是否同意
3341
3315
  * @param _remark 好友备注 同意时有效
3342
- * @returns 设置结果
3343
3316
  */
3344
- setFriendApplyResult(_requestId: string, _isApprove: boolean, _remark?: string): Promise<boolean>;
3317
+ setFriendApplyResult(_requestId: string, _isApprove: boolean, _remark?: string): Promise<void>;
3345
3318
  /**
3346
3319
  * 设置申请加入群请求结果
3347
3320
  * @param _requestId 请求事件ID
3348
3321
  * @param _isApprove 是否同意
3349
3322
  * @param _denyReason 拒绝理由 拒绝时有效
3350
- * @returns 此接口的返回值不值得信任
3351
3323
  */
3352
- setGroupApplyResult(_requestId: string, _isApprove: boolean, _denyReason?: string): Promise<boolean>;
3324
+ setGroupApplyResult(_requestId: string, _isApprove: boolean, _denyReason?: string): Promise<void>;
3353
3325
  /**
3354
3326
  * 设置邀请加入群请求结果
3355
3327
  * @param _requestId 请求事件ID
3356
3328
  * @param _isApprove 是否同意
3357
- * @returns 此接口的返回值不值得信任
3358
3329
  */
3359
- setInvitedJoinGroupResult(_requestId: string, _isApprove: boolean): Promise<boolean>;
3330
+ setInvitedJoinGroupResult(_requestId: string, _isApprove: boolean): Promise<void>;
3360
3331
  /**
3361
3332
  * 设置消息表情回应
3362
3333
  * @param _contact 目标信息
3363
3334
  * @param _messageId 消息ID
3364
3335
  * @param _faceId 表情ID
3365
- * @returns 此接口的返回值不值得信任
3366
3336
  */
3367
- setMsgReaction(_contact: Contact, _messageId: string, _faceId: number, _isSet: boolean): Promise<boolean>;
3337
+ setMsgReaction(_contact: Contact, _messageId: string, _faceId: number, _isSet: boolean): Promise<void>;
3368
3338
  /**
3369
3339
  * 上传群文件、私聊文件
3370
3340
  * @param _contact 目标信息
3371
3341
  * @param _file 本地文件绝对路径
3372
3342
  * @param _name 文件名称 必须提供
3373
3343
  * @param _folder 父目录ID 不提供则上传到根目录 仅在群聊时有效
3374
- * @returns 此接口的返回值不值得信任
3375
3344
  */
3376
- uploadFile(_contact: Contact, _file: string, _name: string, _folder?: string): Promise<boolean>;
3345
+ uploadFile(_contact: Contact, _file: string, _name: string, _folder?: string): Promise<void>;
3377
3346
  /**
3378
3347
  * 让协议端下载文件到协议端本地
3379
3348
  * @param _options 下载文件的选项
@@ -3443,7 +3412,6 @@ declare abstract class AdapterBase<T = any> implements AdapterType<T> {
3443
3412
  * 设置群备注
3444
3413
  * @param _groupId 群号
3445
3414
  * @param _remark 新的备注
3446
- * @returns 此接口的返回值不值得信任
3447
3415
  */
3448
3416
  setGroupRemark(_groupId: string, _remark: string): Promise<boolean>;
3449
3417
  /**
@@ -3467,7 +3435,6 @@ declare abstract class AdapterBase<T = any> implements AdapterType<T> {
3467
3435
  * 戳一戳用户 支持群聊和私聊
3468
3436
  * @param _contact 目标信息
3469
3437
  * @param _count 戳一戳次数 默认为1
3470
- * @returns 此接口的返回值不值得信任
3471
3438
  */
3472
3439
  pokeUser(_contact: Contact, _count?: number): Promise<boolean>;
3473
3440
  /**
@@ -3494,9 +3461,8 @@ declare abstract class AdapterBase<T = any> implements AdapterType<T> {
3494
3461
  /**
3495
3462
  * 设置头像
3496
3463
  * @param file base64:// file:// http(s)://
3497
- * @returns 是否设置成功
3498
3464
  */
3499
- setAvatar(_file: string): Promise<boolean>;
3465
+ setAvatar(_file: string): Promise<void>;
3500
3466
  /**
3501
3467
  * 获取 rkey
3502
3468
  * @returns rkey
@@ -11921,8 +11887,8 @@ interface OneBotMessageApi {
11921
11887
  params: {
11922
11888
  group_id: number;
11923
11889
  message_id: number;
11924
- emoji_id: string;
11925
- set: boolean;
11890
+ code: string;
11891
+ is_add: boolean;
11926
11892
  };
11927
11893
  response: null;
11928
11894
  };
@@ -14285,11 +14251,11 @@ declare abstract class OneBotCore extends EventEmitter$1 {
14285
14251
  * Lagrange扩展: 给消息添加表情回应
14286
14252
  * @param group_id - 群ID
14287
14253
  * @param message_id - 消息ID
14288
- * @param emoji_id - 表情ID
14289
- * @param set - 设置或取消
14254
+ * @param code - 表情ID
14255
+ * @param is_add - 是否为添加
14290
14256
  * @returns
14291
14257
  */
14292
- lgl_setGroupReaction(group_id: number, message_id: number, emoji_id: string, set: boolean): Promise<null>;
14258
+ lgl_setGroupReaction(group_id: number, message_id: number, code: string, is_add: boolean): Promise<null>;
14293
14259
  /**
14294
14260
  * NapCat扩展: 给消息添加表情回应
14295
14261
  * @param message_id - 消息ID
@@ -15689,8 +15655,6 @@ type OneBotHttpClientOptions = {
15689
15655
  headers?: Record<string, string>;
15690
15656
  /** 最大重连次数 默认100次 */
15691
15657
  maxReconnectAttempts?: number;
15692
- /** 发送第一次心跳时间`(触发OPEN事件)` 默认200ms */
15693
- firstHeartbeatTimeout?: number;
15694
15658
  } & OneBotCore['_options'];
15695
15659
  /** http客户端内部配置 */
15696
15660
  type OneBotHttpClientInternalOptions = Required<Omit<OneBotHttpClientOptions, 'firstHeartbeatTimeout'>>;
@@ -16057,7 +16021,7 @@ declare class AdapterOneBot<T extends OneBotType> extends AdapterBase {
16057
16021
  * @param contact ob11无需提供contact参数
16058
16022
  * @param messageId 消息ID
16059
16023
  */
16060
- recallMsg(_: Contact, messageId: string): Promise<boolean>;
16024
+ recallMsg(_: Contact, messageId: string): Promise<void>;
16061
16025
  /**
16062
16026
  * 获取消息
16063
16027
  * @param contact 联系人信息
@@ -16120,7 +16084,7 @@ declare class AdapterOneBot<T extends OneBotType> extends AdapterBase {
16120
16084
  * @param count 赞的次数
16121
16085
  * @returns 此接口的返回值不值得信任
16122
16086
  */
16123
- sendLike(targetId: string, count: number): Promise<boolean>;
16087
+ sendLike(targetId: string, count: number): Promise<void>;
16124
16088
  /**
16125
16089
  * 群踢人
16126
16090
  * @param groupId 群ID
@@ -16129,7 +16093,7 @@ declare class AdapterOneBot<T extends OneBotType> extends AdapterBase {
16129
16093
  * @param kickReason 踢出原因,可选
16130
16094
  * @returns 此接口的返回值不值得信任
16131
16095
  */
16132
- groupKickMember(groupId: string, targetId: string, rejectAddRequest?: boolean, _?: string): Promise<boolean>;
16096
+ groupKickMember(groupId: string, targetId: string, rejectAddRequest?: boolean, _?: string): Promise<void>;
16133
16097
  /**
16134
16098
  * 禁言群成员
16135
16099
  * @param groupId 群ID
@@ -16137,14 +16101,14 @@ declare class AdapterOneBot<T extends OneBotType> extends AdapterBase {
16137
16101
  * @param duration 禁言时长 单位:秒
16138
16102
  * @returns 此接口的返回值不值得信任
16139
16103
  */
16140
- setGroupMute(groupId: string, targetId: string, duration: number): Promise<boolean>;
16104
+ setGroupMute(groupId: string, targetId: string, duration: number): Promise<void>;
16141
16105
  /**
16142
16106
  * 群全员禁言
16143
16107
  * @param groupId 群ID
16144
16108
  * @param isBan 是否开启全员禁言
16145
16109
  * @returns 此接口的返回值不值得信任
16146
16110
  */
16147
- setGroupAllMute(groupId: string, isBan: boolean): Promise<boolean>;
16111
+ setGroupAllMute(groupId: string, isBan: boolean): Promise<void>;
16148
16112
  /**
16149
16113
  * 设置群管理员
16150
16114
  * @param groupId 群ID
@@ -16152,7 +16116,7 @@ declare class AdapterOneBot<T extends OneBotType> extends AdapterBase {
16152
16116
  * @param isAdmin 是否设置为管理员
16153
16117
  * @returns 此接口的返回值不值得信任
16154
16118
  */
16155
- setGroupAdmin(groupId: string, targetId: string, isAdmin: boolean): Promise<boolean>;
16119
+ setGroupAdmin(groupId: string, targetId: string, isAdmin: boolean): Promise<void>;
16156
16120
  /**
16157
16121
  * 设置群名片
16158
16122
  * @param groupId 群ID
@@ -16160,21 +16124,21 @@ declare class AdapterOneBot<T extends OneBotType> extends AdapterBase {
16160
16124
  * @param card 新的群名片
16161
16125
  * @returns 此接口的返回值不值得信任
16162
16126
  */
16163
- setGroupMemberCard(groupId: string, targetId: string, card: string): Promise<boolean>;
16127
+ setGroupMemberCard(groupId: string, targetId: string, card: string): Promise<void>;
16164
16128
  /**
16165
16129
  * 设置群名
16166
16130
  * @param groupId 群ID
16167
16131
  * @param groupName 新的群名
16168
16132
  * @returns 此接口的返回值不值得信任
16169
16133
  */
16170
- setGroupName(groupId: string, groupName: string): Promise<boolean>;
16134
+ setGroupName(groupId: string, groupName: string): Promise<void>;
16171
16135
  /**
16172
16136
  * 退出群组
16173
16137
  * @param groupId 群ID
16174
16138
  * @param isDismiss 如果Bot是群主,是否解散群
16175
16139
  * @returns 此接口的返回值不值得信任
16176
16140
  */
16177
- setGroupQuit(groupId: string, isDismiss: boolean): Promise<boolean>;
16141
+ setGroupQuit(groupId: string, isDismiss: boolean): Promise<void>;
16178
16142
  /**
16179
16143
  * 设置群专属头衔 仅群主可用
16180
16144
  * @param groupId 群ID
@@ -16182,7 +16146,7 @@ declare class AdapterOneBot<T extends OneBotType> extends AdapterBase {
16182
16146
  * @param title 新的专属头衔
16183
16147
  * @returns 此接口的返回值不值得信任
16184
16148
  */
16185
- setGroupMemberTitle(groupId: string, targetId: string, title: string): Promise<boolean>;
16149
+ setGroupMemberTitle(groupId: string, targetId: string, title: string): Promise<void>;
16186
16150
  /**
16187
16151
  * 获取陌生人信息
16188
16152
  * @param targetId 用户ID 任选其一
@@ -16462,7 +16426,7 @@ declare class AdapterOneBot<T extends OneBotType> extends AdapterBase {
16462
16426
  * @param faceId 表情ID
16463
16427
  * @returns 此接口的返回值不值得信任
16464
16428
  */
16465
- setMsgReaction(contact: Contact, messageId: string, faceId: number, isSet: boolean): Promise<boolean>;
16429
+ setMsgReaction(contact: Contact, messageId: string, faceId: number, isSet: boolean): Promise<void>;
16466
16430
  /**
16467
16431
  * 获取版本信息
16468
16432
  */
@@ -16502,14 +16466,14 @@ declare class AdapterOneBot<T extends OneBotType> extends AdapterBase {
16502
16466
  * @param folder 父目录ID 不提供则上传到根目录 仅在群聊时有效
16503
16467
  * @returns 此接口的返回值不值得信任
16504
16468
  */
16505
- uploadFile(contact: Contact, file: string, name: string, folder?: string): Promise<boolean>;
16469
+ uploadFile(contact: Contact, file: string, name: string, folder?: string): Promise<void>;
16506
16470
  /**
16507
16471
  * 设置、取消群精华消息
16508
16472
  * @param groupId 群ID
16509
16473
  * @param messageId 群消息ID
16510
16474
  * @param create true为添加精华消息,false为删除精华消息 默认为true
16511
16475
  */
16512
- setGgroupHighlights(_: string, messageId: string, create: boolean): Promise<boolean>;
16476
+ setGgroupHighlights(_: string, messageId: string, create: boolean): Promise<void>;
16513
16477
  PokeMember(_: string, __: string): Promise<void>;
16514
16478
  /**
16515
16479
  * 设置好友请求结果
@@ -16518,7 +16482,7 @@ declare class AdapterOneBot<T extends OneBotType> extends AdapterBase {
16518
16482
  * @param remark 好友备注 同意时有效
16519
16483
  * @returns 设置结果
16520
16484
  */
16521
- setFriendApplyResult(requestId: string, isApprove: boolean, remark?: string): Promise<boolean>;
16485
+ setFriendApplyResult(requestId: string, isApprove: boolean, remark?: string): Promise<void>;
16522
16486
  /**
16523
16487
  * 设置申请加入群请求结果
16524
16488
  * @param requestId 请求事件ID
@@ -16526,14 +16490,14 @@ declare class AdapterOneBot<T extends OneBotType> extends AdapterBase {
16526
16490
  * @param denyReason 拒绝理由 拒绝时有效
16527
16491
  * @returns 此接口的返回值不值得信任
16528
16492
  */
16529
- setGroupApplyResult(requestId: string, isApprove: boolean, denyReason?: string): Promise<boolean>;
16493
+ setGroupApplyResult(requestId: string, isApprove: boolean, denyReason?: string): Promise<void>;
16530
16494
  /**
16531
16495
  * 设置邀请加入群请求结果
16532
16496
  * @param requestId 请求事件ID
16533
16497
  * @param isApprove 是否同意
16534
16498
  * @returns 此接口的返回值不值得信任
16535
16499
  */
16536
- setInvitedJoinGroupResult(requestId: string, isApprove: boolean): Promise<boolean>;
16500
+ setInvitedJoinGroupResult(requestId: string, isApprove: boolean): Promise<void>;
16537
16501
  /**
16538
16502
  * 合并转发 karin -> adapter
16539
16503
  * @param elements 消息元素
@@ -16634,7 +16598,7 @@ declare class AdapterOneBot<T extends OneBotType> extends AdapterBase {
16634
16598
  * @param file base64:// file:// http(s)://
16635
16599
  * @returns 是否设置成功
16636
16600
  */
16637
- setAvatar(file: string): Promise<boolean>;
16601
+ setAvatar(file: string): Promise<void>;
16638
16602
  /**
16639
16603
  * 获取群 Ai 语音可用声色列表
16640
16604
  * @returns 声色列表
package/dist/index.mjs CHANGED
@@ -2507,7 +2507,6 @@ var init_base = __esm({
2507
2507
  * 撤回消息
2508
2508
  * @param _contact 目标信息
2509
2509
  * @param _messageId 消息ID
2510
- * @returns 此接口的返回值不值得信任
2511
2510
  */
2512
2511
  recallMsg(_contact, _messageId) {
2513
2512
  throw new Error(this.#errMsg);
@@ -2583,14 +2582,13 @@ var init_base = __esm({
2583
2582
  * @param _messageId 群消息ID
2584
2583
  * @param _create true为添加精华消息,false为删除精华消息 默认为true
2585
2584
  */
2586
- setGgroupHighlights(_groupId, _messageId, _create) {
2585
+ setGroupHighlights(_groupId, _messageId, _create) {
2587
2586
  throw new Error(this.#errMsg);
2588
2587
  }
2589
2588
  /**
2590
2589
  * 发送好友赞
2591
2590
  * @param _targetId 目标ID
2592
2591
  * @param _count 赞的次数
2593
- * @returns 此接口的返回值不值得信任
2594
2592
  */
2595
2593
  sendLike(_targetId, _count) {
2596
2594
  throw new Error(this.#errMsg);
@@ -2601,7 +2599,6 @@ var init_base = __esm({
2601
2599
  * @param _targetId 被踢出目标的ID 任选其一
2602
2600
  * @param _rejectAddRequest 是否拒绝再次申请,默认为false
2603
2601
  * @param _kickReason 踢出原因,可选
2604
- * @returns 此接口的返回值不值得信任
2605
2602
  */
2606
2603
  groupKickMember(_groupId, _targetId, _rejectAddRequest, _kickReason) {
2607
2604
  throw new Error(this.#errMsg);
@@ -2611,7 +2608,6 @@ var init_base = __esm({
2611
2608
  * @param _groupId 群ID
2612
2609
  * @param _targetId 被禁言目标的ID 任选其一
2613
2610
  * @param _duration 禁言时长 单位:秒
2614
- * @returns 此接口的返回值不值得信任
2615
2611
  */
2616
2612
  setGroupMute(_groupId, _targetId, _duration) {
2617
2613
  throw new Error(this.#errMsg);
@@ -2620,7 +2616,6 @@ var init_base = __esm({
2620
2616
  * 群全员禁言
2621
2617
  * @param _groupId 群ID
2622
2618
  * @param _isBan 是否开启全员禁言
2623
- * @returns 此接口的返回值不值得信任
2624
2619
  */
2625
2620
  setGroupAllMute(_groupId, _isBan) {
2626
2621
  throw new Error(this.#errMsg);
@@ -2630,7 +2625,6 @@ var init_base = __esm({
2630
2625
  * @param _groupId 群ID
2631
2626
  * @param _targetId 目标用户的ID
2632
2627
  * @param _isAdmin 是否设置为管理员
2633
- * @returns 此接口的返回值不值得信任
2634
2628
  */
2635
2629
  setGroupAdmin(_groupId, _targetId, _isAdmin) {
2636
2630
  throw new Error(this.#errMsg);
@@ -2640,7 +2634,6 @@ var init_base = __esm({
2640
2634
  * @param _groupId 群ID
2641
2635
  * @param _targetId 目标用户的ID
2642
2636
  * @param _card 新的群名片
2643
- * @returns 此接口的返回值不值得信任
2644
2637
  */
2645
2638
  setGroupMemberCard(_groupId, _targetId, _card) {
2646
2639
  throw new Error(this.#errMsg);
@@ -2649,7 +2642,6 @@ var init_base = __esm({
2649
2642
  * 设置群名
2650
2643
  * @param _groupId 群ID
2651
2644
  * @param _groupName 新的群名
2652
- * @returns 此接口的返回值不值得信任
2653
2645
  */
2654
2646
  setGroupName(_groupId, _groupName) {
2655
2647
  throw new Error(this.#errMsg);
@@ -2658,7 +2650,6 @@ var init_base = __esm({
2658
2650
  * 退出群组
2659
2651
  * @param _groupId 群ID
2660
2652
  * @param _isDismiss 如果Bot是群主,是否解散群
2661
- * @returns 此接口的返回值不值得信任
2662
2653
  */
2663
2654
  setGroupQuit(_groupId, _isDismiss) {
2664
2655
  throw new Error(this.#errMsg);
@@ -2668,7 +2659,6 @@ var init_base = __esm({
2668
2659
  * @param _groupId 群ID
2669
2660
  * @param _targetId 目标用户的ID
2670
2661
  * @param _title 新的专属头衔
2671
- * @returns 此接口的返回值不值得信任
2672
2662
  */
2673
2663
  setGroupMemberTitle(_groupId, _targetId, _title) {
2674
2664
  throw new Error(this.#errMsg);
@@ -2740,7 +2730,6 @@ var init_base = __esm({
2740
2730
  * @param _requestId 请求事件ID
2741
2731
  * @param _isApprove 是否同意
2742
2732
  * @param _remark 好友备注 同意时有效
2743
- * @returns 设置结果
2744
2733
  */
2745
2734
  setFriendApplyResult(_requestId, _isApprove, _remark) {
2746
2735
  throw new Error(this.#errMsg);
@@ -2750,7 +2739,6 @@ var init_base = __esm({
2750
2739
  * @param _requestId 请求事件ID
2751
2740
  * @param _isApprove 是否同意
2752
2741
  * @param _denyReason 拒绝理由 拒绝时有效
2753
- * @returns 此接口的返回值不值得信任
2754
2742
  */
2755
2743
  setGroupApplyResult(_requestId, _isApprove, _denyReason) {
2756
2744
  throw new Error(this.#errMsg);
@@ -2759,7 +2747,6 @@ var init_base = __esm({
2759
2747
  * 设置邀请加入群请求结果
2760
2748
  * @param _requestId 请求事件ID
2761
2749
  * @param _isApprove 是否同意
2762
- * @returns 此接口的返回值不值得信任
2763
2750
  */
2764
2751
  setInvitedJoinGroupResult(_requestId, _isApprove) {
2765
2752
  throw new Error(this.#errMsg);
@@ -2769,7 +2756,6 @@ var init_base = __esm({
2769
2756
  * @param _contact 目标信息
2770
2757
  * @param _messageId 消息ID
2771
2758
  * @param _faceId 表情ID
2772
- * @returns 此接口的返回值不值得信任
2773
2759
  */
2774
2760
  setMsgReaction(_contact, _messageId, _faceId, _isSet) {
2775
2761
  throw new Error(this.#errMsg);
@@ -2780,7 +2766,6 @@ var init_base = __esm({
2780
2766
  * @param _file 本地文件绝对路径
2781
2767
  * @param _name 文件名称 必须提供
2782
2768
  * @param _folder 父目录ID 不提供则上传到根目录 仅在群聊时有效
2783
- * @returns 此接口的返回值不值得信任
2784
2769
  */
2785
2770
  uploadFile(_contact, _file, _name, _folder) {
2786
2771
  throw new Error(this.#errMsg);
@@ -2872,7 +2857,6 @@ var init_base = __esm({
2872
2857
  * 设置群备注
2873
2858
  * @param _groupId 群号
2874
2859
  * @param _remark 新的备注
2875
- * @returns 此接口的返回值不值得信任
2876
2860
  */
2877
2861
  setGroupRemark(_groupId, _remark) {
2878
2862
  throw new Error(this.#errMsg);
@@ -2904,7 +2888,6 @@ var init_base = __esm({
2904
2888
  * 戳一戳用户 支持群聊和私聊
2905
2889
  * @param _contact 目标信息
2906
2890
  * @param _count 戳一戳次数 默认为1
2907
- * @returns 此接口的返回值不值得信任
2908
2891
  */
2909
2892
  pokeUser(_contact, _count) {
2910
2893
  throw new Error(this.#errMsg);
@@ -2932,7 +2915,6 @@ var init_base = __esm({
2932
2915
  /**
2933
2916
  * 设置头像
2934
2917
  * @param file base64:// file:// http(s)://
2935
- * @returns 是否设置成功
2936
2918
  */
2937
2919
  setAvatar(_file) {
2938
2920
  throw new Error(this.#errMsg);
@@ -3345,12 +3327,14 @@ var init_dist2 = __esm({
3345
3327
  * 格式化Api返回错误
3346
3328
  */
3347
3329
  _formatApiError(action, params, error) {
3348
- return new Error([
3349
- `[${this.self_id}][sendApi] \u8BF7\u6C42\u9519\u8BEF:`,
3350
- ` action: ${action}`,
3351
- ` params: ${this._formatBase64(params)}`,
3352
- ` error: ${error}`
3353
- ].join("\n"));
3330
+ return new Error(
3331
+ [
3332
+ `[${this.self_id}][sendApi] \u8BF7\u6C42\u9519\u8BEF:`,
3333
+ ` action: ${action}`,
3334
+ ` params: ${this._formatBase64(params)}`
3335
+ ].join("\n"),
3336
+ { cause: error }
3337
+ );
3354
3338
  }
3355
3339
  /**
3356
3340
  * 初始化Bot基本信息
@@ -3835,16 +3819,16 @@ var init_dist2 = __esm({
3835
3819
  * Lagrange扩展: 给消息添加表情回应
3836
3820
  * @param group_id - 群ID
3837
3821
  * @param message_id - 消息ID
3838
- * @param emoji_id - 表情ID
3839
- * @param set - 设置或取消
3822
+ * @param code - 表情ID
3823
+ * @param is_add - 是否为添加
3840
3824
  * @returns
3841
3825
  */
3842
- async lgl_setGroupReaction(group_id, message_id, emoji_id, set) {
3826
+ async lgl_setGroupReaction(group_id, message_id, code, is_add) {
3843
3827
  return this.sendApi("set_group_reaction", {
3844
3828
  group_id,
3845
3829
  message_id,
3846
- emoji_id,
3847
- set
3830
+ code,
3831
+ is_add
3848
3832
  });
3849
3833
  }
3850
3834
  /**
@@ -5705,8 +5689,6 @@ var init_dist2 = __esm({
5705
5689
  super(options);
5706
5690
  this._options = this.getOptions(options);
5707
5691
  this.self.id = options.self_id;
5708
- const firstHeartbeatTimeout = options.firstHeartbeatTimeout || 200;
5709
- setTimeout(() => this._sendFirstHeartbeat(), firstHeartbeatTimeout);
5710
5692
  }
5711
5693
  /**
5712
5694
  * 发送第一次心跳
@@ -5719,11 +5701,6 @@ var init_dist2 = __esm({
5719
5701
  error: new Error(`\u53D1\u9001\u7B2C\u4E00\u6B21\u5FC3\u8DF3\u5931\u8D25: \u8BF7\u68C0\u67E5\u76EE\u6807\u5730\u5740\u662F\u5426\u53EF\u8BBF\u95EE: ${this._options.httpHost}`, { cause: error })
5720
5702
  });
5721
5703
  }
5722
- this._initialized = true;
5723
- this.emit(
5724
- "open"
5725
- /* OPEN */
5726
- );
5727
5704
  }
5728
5705
  /**
5729
5706
  * 获取格式化后的配置
@@ -5842,12 +5819,11 @@ var init_dist2 = __esm({
5842
5819
  * 初始化
5843
5820
  */
5844
5821
  async init() {
5845
- if (this._initialized) {
5846
- return;
5847
- }
5848
- this._startHeartbeat();
5822
+ if (this._initialized) return;
5823
+ await this._sendFirstHeartbeat();
5849
5824
  await this._initBotInfo();
5850
5825
  this._initialized = true;
5826
+ this._startHeartbeat();
5851
5827
  this.emit(
5852
5828
  "open"
5853
5829
  /* OPEN */
@@ -5926,7 +5902,6 @@ var init_dist2 = __esm({
5926
5902
  */
5927
5903
  async reconnect() {
5928
5904
  this._initialized = false;
5929
- await this._sendFirstHeartbeat();
5930
5905
  await this.init();
5931
5906
  }
5932
5907
  };
@@ -17776,7 +17751,7 @@ var init_core = __esm({
17776
17751
  * 注册机器人
17777
17752
  */
17778
17753
  registerBot() {
17779
- logger.bot("info", this.selfId, `[onebot11][${this.adapter.communication}] \u8FDE\u63A5\u6210\u529F: ${this.adapter.address}`);
17754
+ logger.bot("info", this.selfId, `[OneBot][${this.adapter.communication}] \u8FDE\u63A5\u6210\u529F: ${this.adapter.address}`);
17780
17755
  this.adapter.index = registerBot(this.adapter.communication, this);
17781
17756
  }
17782
17757
  /**
@@ -17945,12 +17920,7 @@ var init_core = __esm({
17945
17920
  * @param messageId 消息ID
17946
17921
  */
17947
17922
  async recallMsg(_, messageId) {
17948
- try {
17949
- await this._onebot.deleteMsg(Number(messageId));
17950
- return true;
17951
- } catch {
17952
- return false;
17953
- }
17923
+ await this._onebot.deleteMsg(Number(messageId));
17954
17924
  }
17955
17925
  /**
17956
17926
  * 获取消息
@@ -18073,12 +18043,7 @@ var init_core = __esm({
18073
18043
  * @returns 此接口的返回值不值得信任
18074
18044
  */
18075
18045
  async sendLike(targetId, count3) {
18076
- try {
18077
- await this._onebot.sendLike(Number(targetId), count3);
18078
- return true;
18079
- } catch {
18080
- return false;
18081
- }
18046
+ await this._onebot.sendLike(Number(targetId), count3);
18082
18047
  }
18083
18048
  /**
18084
18049
  * 群踢人
@@ -18089,12 +18054,7 @@ var init_core = __esm({
18089
18054
  * @returns 此接口的返回值不值得信任
18090
18055
  */
18091
18056
  async groupKickMember(groupId, targetId, rejectAddRequest, _) {
18092
- try {
18093
- await this._onebot.setGroupKick(Number(groupId), Number(targetId), rejectAddRequest);
18094
- return true;
18095
- } catch {
18096
- return false;
18097
- }
18057
+ await this._onebot.setGroupKick(Number(groupId), Number(targetId), rejectAddRequest);
18098
18058
  }
18099
18059
  /**
18100
18060
  * 禁言群成员
@@ -18104,12 +18064,7 @@ var init_core = __esm({
18104
18064
  * @returns 此接口的返回值不值得信任
18105
18065
  */
18106
18066
  async setGroupMute(groupId, targetId, duration) {
18107
- try {
18108
- await this._onebot.setGroupBan(Number(groupId), Number(targetId), duration);
18109
- return true;
18110
- } catch {
18111
- return false;
18112
- }
18067
+ await this._onebot.setGroupBan(Number(groupId), Number(targetId), duration);
18113
18068
  }
18114
18069
  /**
18115
18070
  * 群全员禁言
@@ -18118,12 +18073,7 @@ var init_core = __esm({
18118
18073
  * @returns 此接口的返回值不值得信任
18119
18074
  */
18120
18075
  async setGroupAllMute(groupId, isBan) {
18121
- try {
18122
- await this._onebot.setGroupWholeBan(Number(groupId), isBan);
18123
- return true;
18124
- } catch {
18125
- return false;
18126
- }
18076
+ await this._onebot.setGroupWholeBan(Number(groupId), isBan);
18127
18077
  }
18128
18078
  /**
18129
18079
  * 设置群管理员
@@ -18133,12 +18083,7 @@ var init_core = __esm({
18133
18083
  * @returns 此接口的返回值不值得信任
18134
18084
  */
18135
18085
  async setGroupAdmin(groupId, targetId, isAdmin) {
18136
- try {
18137
- await this._onebot.setGroupAdmin(Number(groupId), Number(targetId), isAdmin);
18138
- return true;
18139
- } catch {
18140
- return false;
18141
- }
18086
+ await this._onebot.setGroupAdmin(Number(groupId), Number(targetId), isAdmin);
18142
18087
  }
18143
18088
  /**
18144
18089
  * 设置群名片
@@ -18148,12 +18093,7 @@ var init_core = __esm({
18148
18093
  * @returns 此接口的返回值不值得信任
18149
18094
  */
18150
18095
  async setGroupMemberCard(groupId, targetId, card) {
18151
- try {
18152
- await this._onebot.setGroupCard(Number(groupId), Number(targetId), card);
18153
- return true;
18154
- } catch {
18155
- return false;
18156
- }
18096
+ await this._onebot.setGroupCard(Number(groupId), Number(targetId), card);
18157
18097
  }
18158
18098
  /**
18159
18099
  * 设置群名
@@ -18162,12 +18102,7 @@ var init_core = __esm({
18162
18102
  * @returns 此接口的返回值不值得信任
18163
18103
  */
18164
18104
  async setGroupName(groupId, groupName) {
18165
- try {
18166
- await this._onebot.setGroupName(Number(groupId), groupName);
18167
- return true;
18168
- } catch {
18169
- return false;
18170
- }
18105
+ await this._onebot.setGroupName(Number(groupId), groupName);
18171
18106
  }
18172
18107
  /**
18173
18108
  * 退出群组
@@ -18176,12 +18111,7 @@ var init_core = __esm({
18176
18111
  * @returns 此接口的返回值不值得信任
18177
18112
  */
18178
18113
  async setGroupQuit(groupId, isDismiss) {
18179
- try {
18180
- await this._onebot.setGroupLeave(Number(groupId), isDismiss);
18181
- return true;
18182
- } catch {
18183
- return false;
18184
- }
18114
+ await this._onebot.setGroupLeave(Number(groupId), isDismiss);
18185
18115
  }
18186
18116
  /**
18187
18117
  * 设置群专属头衔 仅群主可用
@@ -18191,12 +18121,7 @@ var init_core = __esm({
18191
18121
  * @returns 此接口的返回值不值得信任
18192
18122
  */
18193
18123
  async setGroupMemberTitle(groupId, targetId, title) {
18194
- try {
18195
- await this._onebot.setGroupSpecialTitle(Number(groupId), Number(targetId), title);
18196
- return true;
18197
- } catch {
18198
- return false;
18199
- }
18124
+ await this._onebot.setGroupSpecialTitle(Number(groupId), Number(targetId), title);
18200
18125
  }
18201
18126
  /**
18202
18127
  * 获取陌生人信息
@@ -18531,19 +18456,15 @@ var init_core = __esm({
18531
18456
  * @returns 此接口的返回值不值得信任
18532
18457
  */
18533
18458
  async setMsgReaction(contact3, messageId, faceId, isSet) {
18534
- try {
18535
- if (this.adapter.name === "Lagrange.OneBot") {
18536
- await this._onebot.lgl_setGroupReaction(+contact3.peer, +messageId, faceId + "", isSet);
18537
- return true;
18538
- }
18539
- if (this.adapter.name === "NapCat.OneBot") {
18540
- await this._onebot.nc_setMsgEmojiLike(+messageId, faceId + "", isSet);
18541
- return true;
18542
- }
18543
- throw new Error(`${this.adapter.name} \u4E0D\u652F\u6301\u8BBE\u7F6E\u6D88\u606F\u8868\u60C5\u56DE\u5E94`);
18544
- } catch {
18545
- return false;
18459
+ if (this.adapter.name === "Lagrange.OneBot") {
18460
+ await this._onebot.lgl_setGroupReaction(+contact3.peer, +messageId, faceId + "", isSet);
18461
+ return;
18546
18462
  }
18463
+ if (this.adapter.name === "NapCat.OneBot") {
18464
+ await this._onebot.nc_setMsgEmojiLike(+messageId, faceId + "", isSet);
18465
+ return;
18466
+ }
18467
+ throw new Error(`${this.adapter.name} \u4E0D\u652F\u6301\u8BBE\u7F6E\u6D88\u606F\u8868\u60C5\u56DE\u5E94`);
18547
18468
  }
18548
18469
  /**
18549
18470
  * 获取版本信息
@@ -18628,16 +18549,11 @@ var init_core = __esm({
18628
18549
  * @returns 此接口的返回值不值得信任
18629
18550
  */
18630
18551
  async uploadFile(contact3, file2, name, folder) {
18631
- try {
18632
- if (contact3.scene === "group") {
18633
- await this._onebot.uploadGroupFile(+contact3.peer, file2, name, folder);
18634
- } else {
18635
- await this._onebot.uploadPrivateFile(+contact3.peer, file2, name);
18636
- }
18637
- return true;
18638
- } catch {
18639
- return false;
18552
+ if (contact3.scene === "group") {
18553
+ await this._onebot.uploadGroupFile(+contact3.peer, file2, name, folder);
18554
+ return;
18640
18555
  }
18556
+ await this._onebot.uploadPrivateFile(+contact3.peer, file2, name);
18641
18557
  }
18642
18558
  /**
18643
18559
  * 设置、取消群精华消息
@@ -18646,15 +18562,10 @@ var init_core = __esm({
18646
18562
  * @param create true为添加精华消息,false为删除精华消息 默认为true
18647
18563
  */
18648
18564
  async setGgroupHighlights(_, messageId, create2) {
18649
- try {
18650
- if (create2) {
18651
- await this._onebot.setEssenceMsg(+messageId);
18652
- } else {
18653
- await this._onebot.deleteEssenceMsg(+messageId);
18654
- }
18655
- return true;
18656
- } catch {
18657
- return false;
18565
+ if (create2) {
18566
+ await this._onebot.setEssenceMsg(+messageId);
18567
+ } else {
18568
+ await this._onebot.deleteEssenceMsg(+messageId);
18658
18569
  }
18659
18570
  }
18660
18571
  async PokeMember(_, __) {
@@ -18668,12 +18579,7 @@ var init_core = __esm({
18668
18579
  * @returns 设置结果
18669
18580
  */
18670
18581
  async setFriendApplyResult(requestId, isApprove, remark) {
18671
- try {
18672
- await this._onebot.setFriendAddRequest(requestId, isApprove, remark);
18673
- return true;
18674
- } catch {
18675
- return false;
18676
- }
18582
+ await this._onebot.setFriendAddRequest(requestId, isApprove, remark);
18677
18583
  }
18678
18584
  /**
18679
18585
  * 设置申请加入群请求结果
@@ -18683,12 +18589,7 @@ var init_core = __esm({
18683
18589
  * @returns 此接口的返回值不值得信任
18684
18590
  */
18685
18591
  async setGroupApplyResult(requestId, isApprove, denyReason) {
18686
- try {
18687
- await this._onebot.setGroupAddRequest(requestId, "add", isApprove, denyReason);
18688
- return true;
18689
- } catch {
18690
- return false;
18691
- }
18592
+ await this._onebot.setGroupAddRequest(requestId, "add", isApprove, denyReason);
18692
18593
  }
18693
18594
  /**
18694
18595
  * 设置邀请加入群请求结果
@@ -18697,12 +18598,7 @@ var init_core = __esm({
18697
18598
  * @returns 此接口的返回值不值得信任
18698
18599
  */
18699
18600
  async setInvitedJoinGroupResult(requestId, isApprove) {
18700
- try {
18701
- await this._onebot.setGroupAddRequest(requestId, "invite", isApprove);
18702
- return true;
18703
- } catch {
18704
- return false;
18705
- }
18601
+ await this._onebot.setGroupAddRequest(requestId, "invite", isApprove);
18706
18602
  }
18707
18603
  /**
18708
18604
  * 合并转发 karin -> adapter
@@ -18866,12 +18762,7 @@ var init_core = __esm({
18866
18762
  * @returns 是否设置成功
18867
18763
  */
18868
18764
  async setAvatar(file2) {
18869
- try {
18870
- await this._onebot.setQqAvatar(file2);
18871
- return true;
18872
- } catch {
18873
- return false;
18874
- }
18765
+ await this._onebot.setQqAvatar(file2);
18875
18766
  }
18876
18767
  /**
18877
18768
  * 获取群 Ai 语音可用声色列表
@@ -18997,8 +18888,6 @@ var init_create2 = __esm({
18997
18888
  adapter3.account.selfId = options.self_id;
18998
18889
  adapter3.adapter.communication = "http";
18999
18890
  onebot.on(OneBotEventKey.OPEN, async () => {
19000
- logger.info(`[OneBot] \u5FC3\u8DF3\u6210\u529F: ${options.url}`);
19001
- await adapter3.init();
19002
18891
  adapter3.registerBot();
19003
18892
  });
19004
18893
  onebot.on(OneBotEventKey.CLOSE, async (type) => {
@@ -19024,6 +18913,7 @@ var init_create2 = __esm({
19024
18913
  return logger.error(new Error(`${loggerPrefix} \u53D1\u751F\u9519\u8BEF:`, { cause: args.error }));
19025
18914
  });
19026
18915
  cacheMap.http.set(options.self_id, adapter3);
18916
+ await adapter3.init();
19027
18917
  return adapter3;
19028
18918
  };
19029
18919
  disconnectAllOneBotServer = () => {
@@ -26726,43 +26616,33 @@ var init_input = __esm({
26726
26616
  }
26727
26617
  async recallMsg(_, messageId) {
26728
26618
  logger.info(`[recallMsg] ${messageId}`);
26729
- return true;
26730
26619
  }
26731
26620
  async sendLike(targetId, count3) {
26732
26621
  logger.info(`[sendLike] ${targetId} ${count3}`);
26733
- return true;
26734
26622
  }
26735
26623
  async groupKickMember(groupId, targetId, rejectAddRequest, kickReason) {
26736
26624
  logger.info(`[groupKickMember] ${groupId} ${targetId} ${rejectAddRequest} ${kickReason}`);
26737
- return true;
26738
26625
  }
26739
26626
  async setGroupMute(groupId, targetId, duration) {
26740
26627
  logger.info(`[setGroupMute] ${groupId} ${targetId} ${duration}`);
26741
- return true;
26742
26628
  }
26743
26629
  async setGroupAllMute(groupId, isBan) {
26744
26630
  logger.info(`[setGroupAllMute] ${groupId} ${isBan}`);
26745
- return true;
26746
26631
  }
26747
26632
  async setGroupAdmin(groupId, targetId, isAdmin) {
26748
26633
  logger.info(`[setGroupAdmin] ${groupId} ${targetId} ${isAdmin}`);
26749
- return true;
26750
26634
  }
26751
26635
  async setGroupMemberCard(groupId, targetId, card) {
26752
26636
  logger.info(`[setGroupMemberCard] ${groupId} ${targetId} ${card}`);
26753
- return true;
26754
26637
  }
26755
26638
  async setGroupName(groupId, groupName) {
26756
26639
  logger.info(`[setGroupName] ${groupId} ${groupName}`);
26757
- return true;
26758
26640
  }
26759
26641
  async setGroupQuit(groupId, isDismiss) {
26760
26642
  logger.info(`[setGroupQuit] ${groupId} ${isDismiss}`);
26761
- return true;
26762
26643
  }
26763
26644
  async setGroupMemberTitle(groupId, targetId, title) {
26764
26645
  logger.info(`[setGroupMemberTitle] ${groupId} ${targetId} ${title}`);
26765
- return true;
26766
26646
  }
26767
26647
  async getFriendList(refresh) {
26768
26648
  logger.info(`[getFriendList] ${refresh}`);
@@ -26782,23 +26662,18 @@ var init_input = __esm({
26782
26662
  }
26783
26663
  async setFriendApplyResult(requestId, isApprove, remark) {
26784
26664
  logger.info(`[setFriendApplyResult] ${requestId} ${isApprove} ${remark}`);
26785
- return true;
26786
26665
  }
26787
26666
  async setGroupApplyResult(requestId, isApprove, denyReason) {
26788
26667
  logger.info(`[setGroupApplyResult] ${requestId} ${isApprove} ${denyReason}`);
26789
- return true;
26790
26668
  }
26791
26669
  async setInvitedJoinGroupResult(requestId, isApprove) {
26792
26670
  logger.info(`[setInvitedJoinGroupResult] ${requestId} ${isApprove}`);
26793
- return true;
26794
26671
  }
26795
26672
  async setMsgReaction(contact3, messageId, faceId, isSet) {
26796
26673
  logger.info(`[setMsgReaction] ${contact3} ${messageId} ${faceId} ${isSet}`);
26797
- return true;
26798
26674
  }
26799
26675
  async uploadFile(contact3, file2, name, folder) {
26800
26676
  logger.info(`[uploadFile] ${contact3} ${file2} ${name} ${folder}`);
26801
- return true;
26802
26677
  }
26803
26678
  };
26804
26679
  adapter2 = new AdapterConsole();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-karin",
3
- "version": "1.10.12",
3
+ "version": "1.10.13",
4
4
  "description": "Lightweight, efficient, concise, and stable robot framework.",
5
5
  "keywords": [
6
6
  "node",