@karinjs/adapter-qqbot 3.0.7 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.d.ts +945 -14
  2. package/dist/index.js +740 -55
  3. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { AdapterBase, AdapterType, Contact, CreateGroupFolderResponse, DownloadFileOptions, DownloadFileResponse, ElementTypes, ForwardOptions, GetAiCharactersResponse, GetAtAllCountResponse, GetGroupFileListResponse, GetGroupFileSystemInfoResponse, GetGroupHighlightsResponse, GetGroupMuteListResponse, GetRkeyResponse, GroupInfo, GroupMemberInfo, LogMethodNames, Message, MessageResponse, NodeElement, QQGroupHonorInfo, SendMsgResults, Sender, UserInfo, karinToQQBot } from "node-karin";
2
+ import { AxiosRequestConfig, AxiosResponse } from "node-karin/axios";
2
3
  import FormData from "form-data";
3
4
  //#region src/core/api/types.d.ts
4
5
  /** 上传富媒体文件场景 */
@@ -329,6 +330,497 @@ interface UploadMediaResponse {
329
330
  /** 发送消息的唯一ID,当srv_send_msg设置为true时返回 */
330
331
  id: string;
331
332
  }
333
+ /** 自定义菜单按钮类型 */
334
+ type MenuItemType = 'switch' | 'send_message' | 'link' | 'menu';
335
+ /** 自定义菜单开关配置(仅 type=switch 时有效) */
336
+ interface MenuSwitch {
337
+ /**
338
+ * 开关唯一标识
339
+ *
340
+ * 用户切换开关状态后会发送一条消息,消息 `ext` 字段中携带 `{switch_id}=1`;
341
+ * 关闭后不携带该标识。
342
+ */
343
+ switch_id?: string;
344
+ /** 开关的初始状态,true 默认打开 */
345
+ default?: boolean;
346
+ }
347
+ /** 自定义菜单二级菜单项(不支持再嵌套子菜单) */
348
+ interface SubMenuItem {
349
+ /** 按钮名称,最多 14 个字符(约 7 个中文汉字) */
350
+ name?: string;
351
+ /** 按钮类型,二级菜单仅支持 send_message / link */
352
+ type?: Extract<MenuItemType, 'send_message' | 'link'>;
353
+ /** 发送的内容,仅 type=send_message 时有效,用户点击后自动填入输入框 */
354
+ send_message?: string;
355
+ /** 跳转链接,仅 type=link 时有效,必须以 https:// 开头 */
356
+ link?: string;
357
+ }
358
+ /** 自定义菜单一级菜单项 */
359
+ interface MenuItem {
360
+ /** 按钮名称,最多 10 个字符(一个中文汉字算 2 个字符) */
361
+ name?: string;
362
+ /** 按钮类型 */
363
+ type?: MenuItemType;
364
+ /** 子菜单列表,仅 type=menu 时有效,最多 5 个 */
365
+ sub_menu_items?: SubMenuItem[];
366
+ /** 发送的内容,仅 type=send_message 时有效,用户点击后自动填入输入框 */
367
+ send_message?: string;
368
+ /** 跳转链接,仅 type=link 时有效,必须以 https:// 开头 */
369
+ link?: string;
370
+ /** 开关配置,仅 type=switch 时有效 */
371
+ switch?: MenuSwitch;
372
+ }
373
+ /** 自定义菜单配置 */
374
+ interface Menu {
375
+ /** 菜单项列表,最多 10 个,按列表顺序从左到右展示 */
376
+ items?: MenuItem[];
377
+ }
378
+ /** 查询全局自定义菜单响应(GET /v2/menu) */
379
+ interface GetMenuResponse {
380
+ /** 当前菜单的版本号 */
381
+ version: number;
382
+ /** 当前生效的菜单配置;未设置过菜单时该字段为空 */
383
+ menu?: Menu;
384
+ }
385
+ /** 修改全局自定义菜单响应(PUT /v2/menu) */
386
+ interface UpdateMenuResponse {
387
+ /** 本次修改后的菜单版本号,可用于后续判断配置是否有变更 */
388
+ version: number;
389
+ }
390
+ /** 指令面板生效场景:c2c 单聊 / group 群聊 / channel 文字子频道 / dm 频道私信 */
391
+ type PanelScope = 'c2c' | 'group' | 'channel' | 'dm';
392
+ /** 指令面板作用范围:all 全局生效 / specific 指定用户或群生效 */
393
+ type PanelTargetType = 'all' | 'specific';
394
+ /** 指令面板元素类型 */
395
+ type PanelItemType = 'command' | 'link';
396
+ /** 指令面板元素 */
397
+ interface PanelItem {
398
+ /**
399
+ * 元素名称,最多 14 个字符(约 7 个中文汉字)
400
+ *
401
+ * type=command 时用户点击后该内容会填入聊天输入框;type=link 时仅用于面板展示。
402
+ */
403
+ name?: string;
404
+ /** 元素描述,最多 30 个字符(约 15 个中文汉字),在面板中展示给用户 */
405
+ desc?: string;
406
+ /** 元素类型 */
407
+ type?: PanelItemType;
408
+ /** 是否仅管理员可操作,true 时仅频道/群管理员可点击 */
409
+ only_admin?: boolean;
410
+ /** 跳转链接,仅 type=link 时有效,必须以 https:// 开头 */
411
+ link?: string;
412
+ }
413
+ /** 指令面板配置内容 */
414
+ interface Panel {
415
+ /** 面板元素列表,一个面板最多配置 20 个元素 */
416
+ items?: PanelItem[];
417
+ /** 面板备注,最多 255 个字符,不对用户展示 */
418
+ remark?: string;
419
+ /** 当前版本号 */
420
+ version?: number;
421
+ }
422
+ /** 查询指令面板列表查询参数(GET /v2/panels) */
423
+ interface GetPanelListParams {
424
+ /** 生效场景,必填 */
425
+ scope: PanelScope;
426
+ /** 分页游标,首次请求不传或传空串,后续传上次响应的 next_cursor */
427
+ cursor?: string;
428
+ /** 每页拉取条数,默认 20,最大 50 */
429
+ limit?: number;
430
+ }
431
+ /** 指令面板记录 */
432
+ interface PanelRecord {
433
+ /** 面板 ID */
434
+ panel_id: string;
435
+ /** 生效场景 */
436
+ scope: PanelScope;
437
+ /** 作用范围,仅 c2c/group 场景可能为 specific */
438
+ target_type: PanelTargetType;
439
+ /** 面板配置内容 */
440
+ panel: Panel;
441
+ /** 面板创建时间,RFC3339 格式 */
442
+ created_at?: string;
443
+ /** 面板更新时间,RFC3339 格式 */
444
+ updated_at?: string;
445
+ /** 面板版本号 */
446
+ version: number;
447
+ }
448
+ /** 查询指令面板列表响应(GET /v2/panels) */
449
+ interface GetPanelListResponse {
450
+ /** 面板记录列表,按设置时间倒序排列 */
451
+ records: PanelRecord[];
452
+ /** 下一页游标,空串表示已到最后一页 */
453
+ next_cursor: string;
454
+ /** 是否已拉取到最后一页 */
455
+ is_end: boolean;
456
+ }
457
+ /** 创建指令面板请求体(POST /v2/panels) */
458
+ interface CreatePanelRequest {
459
+ /** 生效场景,channel / dm 场景 target_type 只能为 all */
460
+ scope: PanelScope;
461
+ /** 作用范围,仅 c2c / group 场景支持 specific */
462
+ target_type?: PanelTargetType;
463
+ /** 用户 openid 列表,仅 c2c 场景且 target_type=specific 时有效,一次最多 20 个 */
464
+ user_openids?: string[];
465
+ /** 群 openid 列表,仅 group 场景且 target_type=specific 时有效,一次最多 20 个 */
466
+ group_openids?: string[];
467
+ /** 面板配置内容 */
468
+ panel: Panel;
469
+ }
470
+ /** 创建指令面板响应(POST /v2/panels) */
471
+ interface CreatePanelResponse {
472
+ /** 新创建的面板 ID,后续修改、删除、查询详情均需使用此 ID */
473
+ panel_id: string;
474
+ }
475
+ /** 查询指令面板详情响应(GET /v2/panels/{panel_id}) */
476
+ interface GetPanelResponse extends PanelRecord {
477
+ /** 关联的用户 openid 列表,仅 c2c 场景且 target_type=specific 时返回,最多 1000 条 */
478
+ user_openids?: string[];
479
+ /** 关联的群 openid 列表,仅 group 场景且 target_type=specific 时返回,最多 1000 条 */
480
+ group_openids?: string[];
481
+ }
482
+ /** 修改指令面板响应(PUT /v2/panels/{panel_id}) */
483
+ interface UpdatePanelResponse {
484
+ /** 本次修改后的面板版本号 */
485
+ version: number;
486
+ }
487
+ /** 修改指令面板关联对象请求体(PUT /v2/panels/{panel_id}/target) */
488
+ interface UpdatePanelTargetRequest {
489
+ /** 操作类型:add 添加关联对象 / del 移除关联对象 */
490
+ op: 'add' | 'del';
491
+ /** 用户 openid 列表,仅 c2c 场景有效,一次最多 20 个 */
492
+ user_openids?: string[];
493
+ /** 群 openid 列表,仅 group 场景有效,一次最多 20 个 */
494
+ group_openids?: string[];
495
+ }
496
+ /** 频道信息 */
497
+ interface GuildInfo {
498
+ /** 频道 ID */
499
+ id: string;
500
+ /** 频道名称 */
501
+ name: string;
502
+ /** 频道头像 URL */
503
+ icon?: string;
504
+ /** 频道创建者 ID */
505
+ owner_id?: string;
506
+ /** 当前机器人是否为频道创建者 */
507
+ owner?: boolean;
508
+ /** 加入时间,ISO8601 格式 */
509
+ joined_at?: string;
510
+ /** 频道成员数 */
511
+ member_count?: number;
512
+ /** 频道成员上限 */
513
+ max_members?: number;
514
+ /** 频道简介 */
515
+ description?: string;
516
+ }
517
+ /** 获取机器人加入的频道列表查询参数(GET /users/@me/guilds) */
518
+ interface GetGuildListParams {
519
+ /** 读取此 guild_id 之前的数据,设置时先反序再分页 */
520
+ before?: string;
521
+ /** 读取此 guild_id 之后的数据,与 before 同时设置时 after 无效 */
522
+ after?: string;
523
+ /** 每次拉取条数,默认 100,最大 100 */
524
+ limit?: number;
525
+ }
526
+ /** 子频道类型:0=文字,2=语音,4=分组,10005=直播,10006=应用,10007=论坛 */
527
+ type ChannelType = 0 | 2 | 4 | 10005 | 10006 | 10007;
528
+ /** 文字子频道子类型:0=闲聊,1=公告,2=攻略,3=开黑 */
529
+ type ChannelSubType = 0 | 1 | 2 | 3;
530
+ /** 子频道私密类型:0=公开,1=群主管理员可见,2=群主管理员+指定成员 */
531
+ type ChannelPrivateType = 0 | 1 | 2;
532
+ /** 子频道发言权限:0=无效,1=所有人,2=群主管理员+指定成员 */
533
+ type ChannelSpeakPermission = 0 | 1 | 2;
534
+ /** 子频道信息 */
535
+ interface ChannelInfo {
536
+ /** 子频道 ID */
537
+ id: string;
538
+ /** 所属频道 ID */
539
+ guild_id: string;
540
+ /** 子频道名 */
541
+ name: string;
542
+ /** 子频道类型 */
543
+ type: ChannelType;
544
+ /** 子频道子类型(文字子频道) */
545
+ sub_type?: ChannelSubType;
546
+ /** 排序值,从 1 开始 */
547
+ position?: number;
548
+ /** 所属分组 ID(仅子频道有效) */
549
+ parent_id?: string;
550
+ /** 创建人 ID */
551
+ owner_id?: string;
552
+ /** 子频道私密类型 */
553
+ private_type?: ChannelPrivateType;
554
+ /** 子频道发言权限 */
555
+ speak_permission?: ChannelSpeakPermission;
556
+ /** 应用子频道标识 */
557
+ application_id?: string;
558
+ /** 用户拥有的子频道权限 */
559
+ permissions?: string;
560
+ }
561
+ /** 创建子频道请求体(POST /guilds/{guild_id}/channels) */
562
+ interface CreateChannelRequest {
563
+ /** 子频道名称 */
564
+ name?: string;
565
+ /** 子频道类型 */
566
+ type?: ChannelType;
567
+ /** 子频道子类型 */
568
+ sub_type?: ChannelSubType;
569
+ /** 排序值(分组类型必须 >= 2) */
570
+ position?: number;
571
+ /** 所属分组 ID */
572
+ parent_id?: string;
573
+ /** 私密类型 */
574
+ private_type?: ChannelPrivateType;
575
+ /** 私密成员 ID 列表 */
576
+ private_user_ids?: string[];
577
+ /** 发言权限 */
578
+ speak_permission?: ChannelSpeakPermission;
579
+ /** 应用子频道 AppID */
580
+ application_id?: string;
581
+ }
582
+ /** 修改子频道请求体(PATCH /channels/{channel_id}),只需传入要修改的字段 */
583
+ interface UpdateChannelRequest {
584
+ /** 子频道名 */
585
+ name?: string;
586
+ /** 排序 */
587
+ position?: number;
588
+ /** 分组 ID */
589
+ parent_id?: string;
590
+ /** 私密类型 */
591
+ private_type?: ChannelPrivateType;
592
+ /** 发言权限 */
593
+ speak_permission?: ChannelSpeakPermission;
594
+ }
595
+ /** 生成分享链接请求体(POST /v2/generate_url_link) */
596
+ interface GenerateUrlLinkRequest {
597
+ /** 需要跳转的 URL */
598
+ url_link?: string;
599
+ /**
600
+ * 开发者自定义回调数据,最长 32 字符
601
+ *
602
+ * 用户通过该链接添加机器人时会透传回 `FRIEND_ADD` 事件的 `scene_param`。
603
+ */
604
+ callback_data?: string;
605
+ }
606
+ /** 生成分享链接响应(POST /v2/generate_url_link) */
607
+ interface GenerateUrlLinkResponse {
608
+ /** 生成的分享链接 */
609
+ url_link: string;
610
+ }
611
+ /** 全员禁言模式:none 未开启 / always 始终禁言 / schedule 定时或周期性禁言 */
612
+ type GroupMuteMode = 'none' | 'always' | 'schedule';
613
+ /** 定时禁言规则 */
614
+ interface MuteScheduleRule {
615
+ /** 任务 ID */
616
+ task_id: string;
617
+ /** 禁言开始时间(RFC3339 格式) */
618
+ start_at: string;
619
+ /** 禁言结束时间(RFC3339 格式) */
620
+ end_at: string;
621
+ /** 此规则是否启用 */
622
+ enabled: boolean;
623
+ }
624
+ /** 周期禁言规则 */
625
+ interface MuteRecurringRule {
626
+ /** 任务 ID */
627
+ task_id: string;
628
+ /** 生效星期几列表,取值 1~7(1=周一,7=周日) */
629
+ weekdays: number[];
630
+ /** 时段开始时间,格式 HH:mm(北京时间) */
631
+ start_time: string;
632
+ /** 时段结束时间,格式 HH:mm(北京时间);小于 start_time 表示跨天到次日 */
633
+ end_time: string;
634
+ /** 此规则是否启用 */
635
+ enabled: boolean;
636
+ }
637
+ /** 群级禁言规则(全员禁言配置) */
638
+ interface GlobalMuteRule {
639
+ /** 全员禁言模式 */
640
+ mode: GroupMuteMode;
641
+ /** 定时禁言规则列表 */
642
+ schedule_rules?: MuteScheduleRule[];
643
+ /** 周期禁言规则列表 */
644
+ recurring_rules?: MuteRecurringRule[];
645
+ }
646
+ /** 成员禁言状态 */
647
+ interface MemberMuteState {
648
+ /** 被禁言成员的 openid */
649
+ member_openid: string;
650
+ /** 禁言到期时间(RFC3339 格式) */
651
+ mute_expire_at: string;
652
+ /** 被禁言成员的昵称 */
653
+ username?: string;
654
+ /** 用户在应用/开放平台下的统一标识 */
655
+ union_openid?: string;
656
+ }
657
+ /** 查询群禁言状态响应(GET /v2/groups/{group_openid}/restrict_chat_setting) */
658
+ interface GetGroupMuteSettingResponse {
659
+ /** 群级禁言规则 */
660
+ global_rule?: GlobalMuteRule;
661
+ /** 当前处于禁言中的用户列表(不含已过期) */
662
+ members?: MemberMuteState[];
663
+ }
664
+ /** 入群验证方式 */
665
+ interface JoinRequestVerifyInfo {
666
+ /** 入群验证方式 */
667
+ method: 'verify_message' | 'admin_review_qa';
668
+ /** 验证消息内容,仅 method=verify_message 时可能携带 */
669
+ verify_message?: string;
670
+ /** 问答列表,仅 method=admin_review_qa 时可能携带 */
671
+ review_qa_list?: {
672
+ /** 管理员设置的问题 */
673
+ question: string;
674
+ /** 申请人填写的答案 */
675
+ answer: string;
676
+ }[];
677
+ }
678
+ /** 入群申请 */
679
+ interface JoinRequest {
680
+ /** 申请 ID,需要在审批接口回传 */
681
+ join_request_id: string;
682
+ /** 安全提示语 */
683
+ risk_tips?: string;
684
+ /** 用户在应用/开放平台下的统一标识 */
685
+ union_openid?: string;
686
+ /** 申请人 openid */
687
+ member_openid: string;
688
+ /** 申请人昵称 */
689
+ username?: string;
690
+ /** 申请时间戳(RFC3339 格式) */
691
+ apply_at?: string;
692
+ /** 申请来源:self_apply 主动申请,invited 被邀请 */
693
+ apply_source?: 'self_apply' | 'invited';
694
+ /** 邀请人 openid(apply_source=invited 时有效) */
695
+ invited_by?: string;
696
+ /** 是否为机器人账号 */
697
+ bot?: boolean;
698
+ /** 用户入群验证方式 */
699
+ verify_info?: JoinRequestVerifyInfo;
700
+ }
701
+ /** 入群申请列表查询参数(GET /v2/groups/{group_openid}/join_request_list) */
702
+ interface GetJoinRequestListParams {
703
+ /** 分页游标,首次请求可不传或传空串 */
704
+ cursor?: string;
705
+ /** 单页数量,默认 20,最大 100 */
706
+ limit?: number;
707
+ }
708
+ /** 入群申请列表响应(GET /v2/groups/{group_openid}/join_request_list) */
709
+ interface GetJoinRequestListResponse {
710
+ /** 入群申请列表 */
711
+ list: JoinRequest[];
712
+ /** 下一页游标,空串表示已到末页 */
713
+ next_cursor: string;
714
+ }
715
+ /** 入群申请审批请求体(POST /v2/groups/{group_openid}/approval_join_request/{member_openid}) */
716
+ interface ApprovalJoinRequestBody {
717
+ /** 审批动作:approve 通过,decline 拒绝 */
718
+ op: 'approve' | 'decline';
719
+ /** 申请 ID */
720
+ join_request_id?: string;
721
+ /** 拒绝理由,op=decline 时可填 */
722
+ reject_reason?: string;
723
+ /** 是否同时加入群黑名单,默认 false,op=decline 时可填 */
724
+ add_to_member_blacklist?: boolean;
725
+ }
726
+ /** 入群自动审批策略 */
727
+ interface JoinApprovalStrategy {
728
+ /** 策略 ID */
729
+ strategy_id: string;
730
+ /** 关联的群 openid 列表(创建时使用 group_openids 时返回) */
731
+ group_openids?: string[];
732
+ /** 关联的 QQ 群号列表(创建时使用 group_ids 时返回) */
733
+ group_ids?: string[];
734
+ /** 白名单中的号码数量(估算,可能存在少量误差) */
735
+ whitelist_user_count?: number;
736
+ /** 策略是否启用:on 启用 / off 关闭 */
737
+ is_enable: 'on' | 'off';
738
+ /** 过期时间(RFC3339 格式) */
739
+ expire_at?: string;
740
+ /** 创建时间(RFC3339 格式) */
741
+ created_at?: string;
742
+ /** 最近更新时间(RFC3339 格式) */
743
+ updated_at?: string;
744
+ /** 策略备注 */
745
+ remark?: string;
746
+ }
747
+ /** 查询入群自动审批策略列表查询参数(GET /v2/groups/join_approval_strategy) */
748
+ interface GetJoinApprovalStrategyListParams {
749
+ /** 分页游标,首次请求可不传或传空串 */
750
+ cursor?: string;
751
+ /** 单页数量,默认 20,最大 100 */
752
+ limit?: number;
753
+ }
754
+ /** 查询入群自动审批策略列表响应 */
755
+ interface GetJoinApprovalStrategyListResponse {
756
+ /** 生效中的策略列表 */
757
+ strategies: JoinApprovalStrategy[];
758
+ /** 下一页游标,空串表示已到末页 */
759
+ next_cursor: string;
760
+ }
761
+ /** 创建入群自动审批策略请求体(POST /v2/groups/join_approval_strategy) */
762
+ interface CreateJoinApprovalStrategyRequest {
763
+ /** 关联的群 openid 列表,最多 100 个;与 group_ids 互斥且二选一必填 */
764
+ group_openids?: string[];
765
+ /** 关联的 QQ 群号列表,最多 100 个;与 group_openids 互斥且二选一必填 */
766
+ group_ids?: string[];
767
+ /** 是否启用策略,默认 on */
768
+ is_enable?: 'on' | 'off';
769
+ /** 过期时间(RFC3339 格式),不传默认一年过期 */
770
+ expire_at?: string;
771
+ /** 策略备注,最多 255 个汉字 */
772
+ remark?: string;
773
+ }
774
+ /** 创建入群自动审批策略响应 */
775
+ interface CreateJoinApprovalStrategyResponse {
776
+ /** 服务端生成的策略 ID */
777
+ strategy_id: string;
778
+ /** 是否启用 */
779
+ is_enable: 'on' | 'off';
780
+ /** 过期时间(RFC3339 格式) */
781
+ expire_at?: string;
782
+ }
783
+ /** 修改入群自动审批策略请求体(PATCH /v2/groups/join_approval_strategy/{strategy_id}) */
784
+ interface UpdateJoinApprovalStrategyRequest {
785
+ /** 是否启用策略 */
786
+ is_enable?: 'on' | 'off';
787
+ /** 过期时间(RFC3339 格式) */
788
+ expire_at?: string;
789
+ /** 关联群增删操作;群标识形式须与创建时一致 */
790
+ group_action?: {
791
+ /** 操作类型:add 新增关联群,del 删除关联群 */
792
+ op: 'add' | 'del';
793
+ /** 待操作的群 openid 列表;与 group_ids 互斥 */
794
+ group_openids?: string[];
795
+ /** 待操作的 QQ 群号列表;与 group_openids 互斥 */
796
+ group_ids?: string[];
797
+ };
798
+ /** 策略备注,最多 255 个汉字 */
799
+ remark?: string;
800
+ }
801
+ /** 修改入群自动审批策略响应 */
802
+ interface UpdateJoinApprovalStrategyResponse {
803
+ /** 是否启用 */
804
+ is_enable: 'on' | 'off';
805
+ /** 过期时间(RFC3339 格式) */
806
+ expire_at?: string;
807
+ }
808
+ /** 修改策略白名单号码请求体(POST /v2/groups/join_approval_strategy/{strategy_id}/whitelist_users) */
809
+ interface UpdateWhitelistUsersRequest {
810
+ /** 操作类型:add 新增号码,del 删除号码 */
811
+ op: 'add' | 'del';
812
+ /** QQ 号码列表,单次最多 10000 个;使用字符串类型避免 JS 精度问题 */
813
+ whitelist_users: string[];
814
+ }
815
+ /** 修改策略白名单号码响应 */
816
+ interface UpdateWhitelistUsersResponse {
817
+ /** 策略 ID */
818
+ strategy_id: string;
819
+ /** 操作后策略当前白名单号码数(估算) */
820
+ whitelist_user_count: number;
821
+ /** 策略更新时间(RFC3339 格式) */
822
+ updated_at?: string;
823
+ }
332
824
  //#endregion
333
825
  //#region src/core/internal/axios.d.ts
334
826
  /**
@@ -338,16 +830,148 @@ declare const createAxiosInstance: (appId: string) => import("node-karin/axios")
338
830
  //#endregion
339
831
  //#region src/core/api/http.d.ts
340
832
  type AxiosInstance = ReturnType<typeof createAxiosInstance>;
833
+ /**
834
+ * 单次请求的可选配置。
835
+ *
836
+ * 这是 axios 请求配置的常用子集;需要完整能力时用
837
+ * {@link Http.request} 或直接使用 `axios` 实例。
838
+ */
839
+ interface RequestOptions {
840
+ /** 追加请求头,会与实例默认头合并 */
841
+ headers?: Record<string, string>;
842
+ /** 超时毫秒数,默认取实例配置(5500ms) */
843
+ timeout?: number;
844
+ /** query 参数,axios 会自动序列化后拼到 URL */
845
+ params?: Record<string, unknown>;
846
+ /** 中断信号 */
847
+ signal?: AbortSignal;
848
+ /** 响应类型,下载二进制时可传 `arraybuffer` */
849
+ responseType?: AxiosRequestConfig['responseType'];
850
+ }
341
851
  /**
342
852
  * Http 基础类,子模块继承此类共享 axios 实例与错误格式化
853
+ *
854
+ * 各请求方法均为 `protected`,只供各领域 API 子类内部使用;
855
+ * 需要给下游插件开放的裸请求入口见 {@link RequestApi}。
343
856
  */
344
857
  declare class Http {
345
858
  readonly axios: AxiosInstance;
346
859
  constructor(axios: AxiosInstance);
347
- protected get<T>(path: string): Promise<T>;
348
- protected post<T>(path: string, body?: unknown, headers?: Record<string, string>, timeout?: number): Promise<T>;
349
- protected put<T>(path: string, body?: unknown, headers?: Record<string, string>, timeout?: number): Promise<T>;
350
- protected delete<T>(path: string): Promise<T>;
860
+ protected get<T>(path: string, options?: RequestOptions): Promise<T>;
861
+ protected post<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
862
+ protected put<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
863
+ protected patch<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
864
+ protected delete<T>(path: string, options?: RequestOptions): Promise<T>;
865
+ /**
866
+ * 任意 method 的裸请求,返回响应体。
867
+ *
868
+ * @param config axios 请求配置,`url` 相对 `baseURL`。
869
+ * @returns 响应体 `data`。
870
+ */
871
+ protected request<T>(config: AxiosRequestConfig): Promise<T>;
872
+ /**
873
+ * 任意 method 的裸请求,返回完整 axios 响应。
874
+ *
875
+ * 需要读取响应头或状态码时使用。
876
+ *
877
+ * @param config axios 请求配置,`url` 相对 `baseURL`。
878
+ * @returns 完整 axios 响应。
879
+ */
880
+ protected requestRaw<T>(config: AxiosRequestConfig): Promise<AxiosResponse<T>>;
881
+ }
882
+ //#endregion
883
+ //#region src/core/api/request.d.ts
884
+ /**
885
+ * 裸请求入口,供下游插件直接调用官方 OpenAPI。
886
+ *
887
+ * {@link Http} 的请求方法是 `protected`,只供各领域 API 子类内部使用;
888
+ * 本类把同一套方法以 `public` 暴露出来,用于官方新接口尚未被适配器封装、
889
+ * 或需要传自定义参数的场景:
890
+ *
891
+ * ```ts
892
+ * const bot = e.bot as AdapterQQBot
893
+ *
894
+ * // GET,query 走 params
895
+ * const menu = await bot.super.request.get('/v2/menu')
896
+ * const list = await bot.super.request.get('/v2/panels', { params: { scope: 'group', limit: 20 } })
897
+ *
898
+ * // POST / PUT / PATCH / DELETE
899
+ * await bot.super.request.post(`/v2/groups/${groupId}/messages`, { content: 'hi', msg_type: 0 })
900
+ * await bot.super.request.put('/v2/menu', { menu })
901
+ *
902
+ * // 任意 method
903
+ * await bot.super.request.request({ method: 'POST', url: '/v2/xxx', data: {} })
904
+ * ```
905
+ *
906
+ * 与直接用 `bot.super.axios` 的区别:
907
+ * - 自动解包 `response.data`;
908
+ * - 失败时抛出的 Error 已带请求路径、脱敏请求体、QQ 错误码中文描述和 TraceID。
909
+ *
910
+ * 需要读响应头或状态码时用 {@link RequestApi.requestRaw};
911
+ * 需要完全裸的 axios 时用 `bot.super.axios`。
912
+ *
913
+ * 路径相对官方 API baseURL,鉴权头由拦截器自动注入,无需自己传 Authorization。
914
+ */
915
+ declare class RequestApi extends Http {
916
+ /**
917
+ * GET 请求。
918
+ *
919
+ * @param path 接口路径,相对 baseURL。
920
+ * @param options 可选配置(params / headers / timeout 等)。
921
+ * @returns 响应体。
922
+ */
923
+ get<T = unknown>(path: string, options?: RequestOptions): Promise<T>;
924
+ /**
925
+ * POST 请求。
926
+ *
927
+ * @param path 接口路径,相对 baseURL。
928
+ * @param body 请求体,默认空对象。
929
+ * @param options 可选配置(params / headers / timeout 等)。
930
+ * @returns 响应体。
931
+ */
932
+ post<T = unknown>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
933
+ /**
934
+ * PUT 请求。
935
+ *
936
+ * @param path 接口路径,相对 baseURL。
937
+ * @param body 请求体,默认空对象。
938
+ * @param options 可选配置(params / headers / timeout 等)。
939
+ * @returns 响应体。
940
+ */
941
+ put<T = unknown>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
942
+ /**
943
+ * PATCH 请求。
944
+ *
945
+ * @param path 接口路径,相对 baseURL。
946
+ * @param body 请求体,默认空对象。
947
+ * @param options 可选配置(params / headers / timeout 等)。
948
+ * @returns 响应体。
949
+ */
950
+ patch<T = unknown>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
951
+ /**
952
+ * DELETE 请求。
953
+ *
954
+ * @param path 接口路径,相对 baseURL。
955
+ * @param options 可选配置(params / headers / timeout 等)。
956
+ * @returns 响应体。
957
+ */
958
+ delete<T = unknown>(path: string, options?: RequestOptions): Promise<T>;
959
+ /**
960
+ * 任意 method 的请求,返回响应体。
961
+ *
962
+ * @param config axios 请求配置,`url` 相对 baseURL。
963
+ * @returns 响应体。
964
+ */
965
+ request<T = unknown>(config: AxiosRequestConfig): Promise<T>;
966
+ /**
967
+ * 任意 method 的请求,返回完整 axios 响应。
968
+ *
969
+ * 需要读取响应头或状态码时使用。
970
+ *
971
+ * @param config axios 请求配置,`url` 相对 baseURL。
972
+ * @returns 完整 axios 响应。
973
+ */
974
+ requestRaw<T = unknown>(config: AxiosRequestConfig): Promise<AxiosResponse<T>>;
351
975
  }
352
976
  //#endregion
353
977
  //#region src/core/api/messages.d.ts
@@ -483,7 +1107,7 @@ declare class InteractionApi extends Http {
483
1107
  //#endregion
484
1108
  //#region src/core/api/meta.d.ts
485
1109
  /**
486
- * 元信息接口:@me / dms / gateway
1110
+ * 元信息接口:@me / dms / gateway / 分享链接
487
1111
  */
488
1112
  declare class MetaApi extends Http {
489
1113
  /** 当前机器人详情 */
@@ -494,6 +1118,15 @@ declare class MetaApi extends Http {
494
1118
  getGateway(): Promise<{
495
1119
  url: string;
496
1120
  }>;
1121
+ /**
1122
+ * 生成机器人分享链接
1123
+ *
1124
+ * 用于邀请用户添加机器人为好友;`callback_data`(最长 32 字符)会在用户通过该
1125
+ * 链接添加机器人时透传到 `FRIEND_ADD` 事件的 `scene_param`。
1126
+ *
1127
+ * @param body 分享链接参数,均为可选
1128
+ */
1129
+ generateUrlLink(body?: GenerateUrlLinkRequest): Promise<GenerateUrlLinkResponse>;
497
1130
  }
498
1131
  //#endregion
499
1132
  //#region src/core/api/groups.d.ts
@@ -523,12 +1156,249 @@ declare class GroupsApi extends Http {
523
1156
  getGroupMember(groupOpenid: string, memberOpenid: string): Promise<QQGroupMemberResponse>;
524
1157
  /**
525
1158
  * 设置群成员禁言
1159
+ *
1160
+ * 机器人需拥有群管理员身份,平台限制最大禁言时长为 30 天。
1161
+ *
526
1162
  * @param groupOpenid 群 openid
527
1163
  * @param memberOpenid 群成员 openid
528
1164
  * @param op 操作: add 增加禁言,update 更新禁言到期时间,del 解除禁言
529
1165
  * @param duration 禁言时间使用RFC3339 格式
530
1166
  */
1167
+ setGroupMute(groupOpenid: string, memberOpenid: string, op: 'add' | 'update' | 'del', duration: string): Promise<{}>;
1168
+ /**
1169
+ * 设置群成员禁言
1170
+ * @deprecated 方法名拼写错误,请使用 {@link GroupsApi.setGroupMute}
1171
+ */
531
1172
  setGroupMetu(groupOpenid: string, memberOpenid: string, op: 'add' | 'update' | 'del', duration: string): Promise<{}>;
1173
+ /**
1174
+ * 查询群禁言状态
1175
+ *
1176
+ * 返回全员禁言模式(含定时 / 周期规则)与当前禁言中的成员列表(不含已过期)。
1177
+ * 机器人需拥有群管理员身份。
1178
+ *
1179
+ * @param groupOpenid 群 openid
1180
+ */
1181
+ getGroupMuteSetting(groupOpenid: string): Promise<GetGroupMuteSettingResponse>;
1182
+ /**
1183
+ * 拉取入群申请列表
1184
+ *
1185
+ * 机器人需拥有群管理员身份。
1186
+ *
1187
+ * @param groupOpenid 群 openid
1188
+ * @param params 分页参数,`limit` 默认 20、最大 100
1189
+ */
1190
+ getJoinRequestList(groupOpenid: string, params?: GetJoinRequestListParams): Promise<GetJoinRequestListResponse>;
1191
+ /**
1192
+ * 审批入群申请
1193
+ *
1194
+ * 机器人需拥有群管理员身份。
1195
+ *
1196
+ * @param groupOpenid 群 openid
1197
+ * @param memberOpenid 申请人 openid
1198
+ * @param body 审批动作,`op=decline` 时可附带拒绝理由与拉黑标记
1199
+ */
1200
+ approvalJoinRequest(groupOpenid: string, memberOpenid: string, body: ApprovalJoinRequestBody): Promise<{}>;
1201
+ }
1202
+ //#endregion
1203
+ //#region src/core/api/guilds.d.ts
1204
+ /**
1205
+ * 频道 / 子频道接口
1206
+ *
1207
+ * 子频道的创建、修改、删除均需要管理员权限且属于私域接口,
1208
+ * 操作成功后会触发 `CHANNEL_CREATE` / `CHANNEL_UPDATE` / `CHANNEL_DELETE` 事件。
1209
+ */
1210
+ declare class GuildsApi extends Http {
1211
+ /**
1212
+ * 获取机器人加入的频道列表
1213
+ *
1214
+ * 官方文档响应体标注为 `{ guilds: [] }`,但示例与实际返回均为裸数组;
1215
+ * 这里对两种形态都做兼容。
1216
+ *
1217
+ * @param params 分页参数,`limit` 默认 100、最大 100
1218
+ */
1219
+ getGuildList(params?: GetGuildListParams): Promise<GuildInfo[]>;
1220
+ /**
1221
+ * 获取频道详情
1222
+ * @param guildId 频道 ID
1223
+ */
1224
+ getGuild(guildId: string): Promise<GuildInfo>;
1225
+ /**
1226
+ * 获取子频道列表
1227
+ *
1228
+ * 官方文档响应体标注为 `{ channels: [] }`,但示例与实际返回均为裸数组;
1229
+ * 这里对两种形态都做兼容。
1230
+ *
1231
+ * @param guildId 频道 ID
1232
+ */
1233
+ getChannelList(guildId: string): Promise<ChannelInfo[]>;
1234
+ /**
1235
+ * 创建子频道(需要管理员权限,私域接口)
1236
+ * @param guildId 频道 ID
1237
+ * @param body 子频道配置
1238
+ */
1239
+ createChannel(guildId: string, body: CreateChannelRequest): Promise<ChannelInfo>;
1240
+ /**
1241
+ * 获取子频道详情
1242
+ * @param channelId 子频道 ID
1243
+ */
1244
+ getChannel(channelId: string): Promise<ChannelInfo>;
1245
+ /**
1246
+ * 修改子频道(需要管理员权限,私域接口)
1247
+ *
1248
+ * 只需传入要修改的字段。
1249
+ * @param channelId 子频道 ID
1250
+ * @param body 待修改的字段
1251
+ */
1252
+ updateChannel(channelId: string, body: UpdateChannelRequest): Promise<ChannelInfo>;
1253
+ /**
1254
+ * 删除子频道(需要管理员权限,私域接口)
1255
+ *
1256
+ * 子频道删除后无法恢复。
1257
+ * @param channelId 子频道 ID
1258
+ */
1259
+ deleteChannel(channelId: string): Promise<{}>;
1260
+ }
1261
+ //#endregion
1262
+ //#region src/core/api/menu.d.ts
1263
+ /**
1264
+ * 全局自定义菜单接口
1265
+ *
1266
+ * 自定义菜单展示在机器人单聊窗口底部,仅支持 C2C(单聊)场景,
1267
+ * 设置后对所有用户生效,不支持按用户维度区分。
1268
+ *
1269
+ * {@link https://bot.q.qq.com/wiki/develop/api-v2/server-inter/menu-panel/}
1270
+ */
1271
+ declare class MenuApi extends Http {
1272
+ /**
1273
+ * 查询全局自定义菜单
1274
+ *
1275
+ * 未设置过菜单时响应的 `menu` 字段为空。
1276
+ * @returns 当前生效的菜单配置与版本号
1277
+ */
1278
+ getMenu(): Promise<GetMenuResponse>;
1279
+ /**
1280
+ * 修改全局自定义菜单
1281
+ *
1282
+ * 传入后会覆盖原有的完整菜单配置;不传 `menu` 表示清空菜单。
1283
+ * @param menu 菜单配置,最多 10 个一级菜单项
1284
+ * @returns 本次修改后的菜单版本号
1285
+ */
1286
+ updateMenu(menu?: Menu): Promise<UpdateMenuResponse>;
1287
+ }
1288
+ //#endregion
1289
+ //#region src/core/api/panels.d.ts
1290
+ /**
1291
+ * 指令面板接口
1292
+ *
1293
+ * 指令面板以面板形式展示指令或链接,支持 c2c(单聊)、group(群聊)、
1294
+ * channel(文字子频道)、dm(频道私信)四种场景;其中 c2c / group 支持
1295
+ * 按指定用户或群生效(target_type=specific),channel / dm 仅支持全局配置。
1296
+ *
1297
+ * 一个机器人最多创建 20 个指令面板。
1298
+ *
1299
+ * {@link https://bot.q.qq.com/wiki/develop/api-v2/server-inter/menu-panel/}
1300
+ */
1301
+ declare class PanelsApi extends Http {
1302
+ /**
1303
+ * 查询指令面板列表
1304
+ *
1305
+ * 分页拉取指定场景下已生效的面板,按设置时间倒序排列。
1306
+ * @param params 查询参数,`scope` 必填
1307
+ * @returns 面板记录列表与分页游标
1308
+ */
1309
+ getPanelList(params: GetPanelListParams): Promise<GetPanelListResponse>;
1310
+ /**
1311
+ * 创建指令面板
1312
+ * @param body 面板场景、作用范围与配置内容
1313
+ * @returns 新创建的面板 ID
1314
+ */
1315
+ createPanel(body: CreatePanelRequest): Promise<CreatePanelResponse>;
1316
+ /**
1317
+ * 查询指令面板详情
1318
+ *
1319
+ * 返回面板完整配置,target_type=specific 时同时返回关联的用户 / 群 openid 列表。
1320
+ * @param panelId 面板 ID
1321
+ */
1322
+ getPanel(panelId: string): Promise<GetPanelResponse>;
1323
+ /**
1324
+ * 修改指令面板
1325
+ *
1326
+ * 传入后会覆盖原有的面板元素列表和备注,不影响已关联的用户 / 群列表。
1327
+ * @param panelId 面板 ID
1328
+ * @param panel 面板配置内容
1329
+ * @returns 本次修改后的面板版本号
1330
+ */
1331
+ updatePanel(panelId: string, panel: Panel): Promise<UpdatePanelResponse>;
1332
+ /**
1333
+ * 删除指令面板
1334
+ *
1335
+ * 删除后该面板不再对任何用户或群生效。
1336
+ * @param panelId 面板 ID
1337
+ */
1338
+ deletePanel(panelId: string): Promise<{}>;
1339
+ /**
1340
+ * 修改指令面板关联对象
1341
+ *
1342
+ * c2c 场景操作 `user_openids`,group 场景操作 `group_openids`,一次最多 20 个;
1343
+ * channel / dm 场景为全局配置,不支持此操作。
1344
+ * @param panelId 面板 ID
1345
+ * @param body 操作类型与关联对象列表
1346
+ */
1347
+ updatePanelTarget(panelId: string, body: UpdatePanelTargetRequest): Promise<{}>;
1348
+ }
1349
+ //#endregion
1350
+ //#region src/core/api/join-approval.d.ts
1351
+ /**
1352
+ * 入群自动审批策略接口
1353
+ *
1354
+ * 策略把「关联群 + 白名单 QQ 号码」绑在一起,命中白名单的入群申请会自动审批通过。
1355
+ * 规则仅在机器人拥有群管理员身份时才会实际运行;一个机器人最多 20 个策略。
1356
+ */
1357
+ declare class JoinApprovalApi extends Http {
1358
+ /**
1359
+ * 查询入群自动审批策略列表
1360
+ *
1361
+ * 按创建时间倒序,支持分页。
1362
+ * @param params 分页参数,`limit` 默认 20、最大 100
1363
+ */
1364
+ getStrategyList(params?: GetJoinApprovalStrategyListParams): Promise<GetJoinApprovalStrategyListResponse>;
1365
+ /**
1366
+ * 创建入群自动审批策略
1367
+ *
1368
+ * `group_openids` 与 `group_ids` 二选一必填,同时传入或均未传入都会报错。
1369
+ * @param body 策略配置
1370
+ */
1371
+ createStrategy(body: CreateJoinApprovalStrategyRequest): Promise<CreateJoinApprovalStrategyResponse>;
1372
+ /**
1373
+ * 修改入群自动审批策略
1374
+ *
1375
+ * 可修改生效状态、失效时间、备注,或增删关联群;
1376
+ * 增删关联群时的群标识形式必须与创建时一致。
1377
+ * @param strategyId 策略 ID
1378
+ * @param body 待修改的字段
1379
+ */
1380
+ updateStrategy(strategyId: string, body: UpdateJoinApprovalStrategyRequest): Promise<UpdateJoinApprovalStrategyResponse>;
1381
+ /**
1382
+ * 删除入群自动审批策略
1383
+ * @param strategyId 策略 ID
1384
+ */
1385
+ deleteStrategy(strategyId: string): Promise<{}>;
1386
+ /**
1387
+ * 执行入群自动审批策略
1388
+ *
1389
+ * 对策略关联的全部群发起全量扫描,命中白名单号码的入群申请自动审批通过。
1390
+ * 异步执行,约 10 分钟完成。
1391
+ * @param strategyId 策略 ID
1392
+ */
1393
+ executeStrategy(strategyId: string): Promise<{}>;
1394
+ /**
1395
+ * 修改入群自动审批策略的白名单号码
1396
+ *
1397
+ * 单次最多 10000 个,策略号码上限 10W。
1398
+ * @param strategyId 策略 ID
1399
+ * @param body 操作类型与号码列表
1400
+ */
1401
+ updateWhitelistUsers(strategyId: string, body: UpdateWhitelistUsersRequest): Promise<UpdateWhitelistUsersResponse>;
532
1402
  }
533
1403
  //#endregion
534
1404
  //#region src/core/api/index.d.ts
@@ -539,18 +1409,41 @@ declare class GroupsApi extends Http {
539
1409
  * - messages:发送 / 撤回
540
1410
  * - media:富媒体上传
541
1411
  * - interaction:按钮回调 ack
542
- * - meta:@me / dms / gateway
543
- * - groups:群基础信息 / 机器人群内状态(白名单接口)
1412
+ * - meta:@me / dms / gateway / 分享链接
1413
+ * - groups:群基础信息 / 机器人群内状态 / 禁言 / 入群申请(部分为白名单接口)
1414
+ * - guilds:频道与子频道的查询和增删改
1415
+ * - menu:全局自定义菜单(仅单聊)
1416
+ * - panels:指令面板
1417
+ * - joinApproval:入群自动审批策略
1418
+ * - request:裸请求入口,用于调用尚未封装的官方接口
544
1419
  *
545
1420
  * 请求体构造器 {@link buildQQMsg} / {@link buildGuildMsg} 独立导出,避免与 HTTP 调用耦合
546
1421
  */
547
1422
  declare class QQBotApi {
548
1423
  readonly axios: AxiosInstance;
1424
+ /**
1425
+ * 裸请求入口,直接调用官方 OpenAPI。
1426
+ *
1427
+ * 官方新接口还没被适配器封装时可用它兜底,会自动带鉴权、解包 `data`、
1428
+ * 格式化错误码:
1429
+ *
1430
+ * ```ts
1431
+ * await bot.super.request.get('/v2/menu')
1432
+ * await bot.super.request.post('/v2/xxx', { foo: 1 })
1433
+ * ```
1434
+ *
1435
+ * @see {@link RequestApi}
1436
+ */
1437
+ readonly request: RequestApi;
549
1438
  readonly messages: MessagesApi;
550
1439
  readonly media: MediaApi;
551
1440
  readonly interaction: InteractionApi;
552
1441
  readonly meta: MetaApi;
553
1442
  readonly groups: GroupsApi;
1443
+ readonly guilds: GuildsApi;
1444
+ readonly menu: MenuApi;
1445
+ readonly panels: PanelsApi;
1446
+ readonly joinApproval: JoinApprovalApi;
554
1447
  /** 请求体构造器(静态便利) */
555
1448
  readonly qq: {
556
1449
  text(content: string): SendQQTextMessageRequest;
@@ -1145,6 +2038,13 @@ declare class AdapterQQBot extends AdapterBase implements AdapterType {
1145
2038
  groupKickMember(_groupId: string, _targetId: string, _rejectAddRequest?: boolean, _kickReason?: string): Promise<void>;
1146
2039
  /**
1147
2040
  * 禁言群成员
2041
+ *
2042
+ * 机器人需拥有群管理员身份;平台限制最大禁言时长为 30 天,
2043
+ * 超出部分会被截断到 30 天而不是直接失败。
2044
+ *
2045
+ * @param _groupId 群 openid
2046
+ * @param _targetId 群成员 openid
2047
+ * @param duration 禁言时长(秒),传 0 或负数表示解除禁言
1148
2048
  */
1149
2049
  setGroupMute(_groupId: string, _targetId: string, duration: number): Promise<void>;
1150
2050
  /**
@@ -1182,12 +2082,18 @@ declare class AdapterQQBot extends AdapterBase implements AdapterType {
1182
2082
  /**
1183
2083
  * 获取群信息
1184
2084
  *
1185
- * 走官方 `GET /v2/groups/{group_openid}/info`(白名单接口)。
1186
- * 未开通权限(11253)或查询失败时降级为空结构并告警。
2085
+ * QQ 群走官方 `GET /v2/groups/{group_openid}/info`(白名单接口);传入的是频道
2086
+ * ID 时退回 `GET /guilds/{guild_id}`,这样频道场景下的插件调用也能拿到名称和
2087
+ * 人数。两者都不可用(如白名单未开通返回 11253)时降级为空结构并告警。
2088
+ *
2089
+ * @param _groupId 群 openid 或频道 ID。
1187
2090
  */
1188
2091
  getGroupInfo(_groupId: string, _noCache?: boolean): Promise<GroupInfo>;
1189
2092
  /**
1190
2093
  * 获取群列表
2094
+ *
2095
+ * 官方没有 QQ 群列表接口。频道列表可用 `bot.super.guilds.getGuildList()` 获取,
2096
+ * 但频道在 Karin 里属于 guild 场景,与 QQ 群不是同一类会话,因此不在此处混用。
1191
2097
  */
1192
2098
  getGroupList(_refresh?: boolean): Promise<Array<GroupInfo>>;
1193
2099
  /**
@@ -1212,13 +2118,29 @@ declare class AdapterQQBot extends AdapterBase implements AdapterType {
1212
2118
  */
1213
2119
  setFriendApplyResult(_requestId: string, _isApprove: boolean, _remark?: string): Promise<void>;
1214
2120
  /**
1215
- * 设置申请加入群请求结果
2121
+ * 审批入群申请。
2122
+ *
2123
+ * 走官方 `POST /v2/groups/{group_openid}/approval_join_request/{member_openid}`,
2124
+ * 机器人需拥有群管理员身份。Karin 只透传 flag(`join_request_id`),群与申请人
2125
+ * openid 由 `join-request-cache` 在收到申请事件时记录,因此仅支持审批本次运行
2126
+ * 期间收到过的申请;历史申请请改用
2127
+ * `bot.super.groups.getJoinRequestList()` + `bot.super.groups.approvalJoinRequest()`。
2128
+ *
2129
+ * @param requestId 申请 ID(Karin 请求事件的 flag)。
2130
+ * @param isApprove 是否通过。
2131
+ * @param denyReason 拒绝理由,仅拒绝时生效。
1216
2132
  */
1217
- setGroupApplyResult(_requestId: string, _isApprove: boolean, _denyReason?: string): Promise<void>;
2133
+ setGroupApplyResult(requestId: string, isApprove: boolean, denyReason?: string): Promise<void>;
1218
2134
  /**
1219
- * 设置邀请加入群请求结果
2135
+ * 设置邀请加入群请求结果。
2136
+ *
2137
+ * 机器人被邀请入群与用户主动申请入群在官方侧是同一条 `GROUP_JOIN_REQUEST`
2138
+ * 事件,审批走同一个接口,因此直接复用 {@link AdapterQQBot.setGroupApplyResult}。
2139
+ *
2140
+ * @param requestId 申请 ID(Karin 请求事件的 flag)。
2141
+ * @param isApprove 是否通过。
1220
2142
  */
1221
- setInvitedJoinGroupResult(_requestId: string, _isApprove: boolean): Promise<void>;
2143
+ setInvitedJoinGroupResult(requestId: string, isApprove: boolean): Promise<void>;
1222
2144
  /**
1223
2145
  * 设置消息表情回应
1224
2146
  */
@@ -1283,6 +2205,15 @@ declare class AdapterQQBot extends AdapterBase implements AdapterType {
1283
2205
  getAtAllCount(_groupId: string): Promise<GetAtAllCountResponse>;
1284
2206
  /**
1285
2207
  * 获取群被禁言用户列表
2208
+ *
2209
+ * 走官方 `GET /v2/groups/{group_openid}/restrict_chat_setting`,只返回仍在
2210
+ * 禁言中的成员(不含已过期)。机器人需拥有群管理员身份,无权限或查询失败时
2211
+ * 降级为空数组并告警。
2212
+ *
2213
+ * `muteTime` 为禁言到期时间的 Unix 秒,而非剩余时长;全员禁言规则不在该返回
2214
+ * 结构内,需要时请用 `bot.super.groups.getGroupMuteSetting()` 读取 `global_rule`。
2215
+ *
2216
+ * @param _groupId 群 openid
1286
2217
  */
1287
2218
  getGroupMuteList(_groupId: string): Promise<Array<GetGroupMuteListResponse>>;
1288
2219
  /**
@@ -1328,4 +2259,4 @@ declare class AdapterQQBot extends AdapterBase implements AdapterType {
1328
2259
  }>;
1329
2260
  }
1330
2261
  //#endregion
1331
- export type { AdapterQQBot };
2262
+ export { type AdapterQQBot, type AxiosInstance, Http, QQBotApi, RequestApi, type RequestOptions };