diff --git a/docs/changelogs/CHANGELOG.v1.3.5.md b/docs/changelogs/CHANGELOG.v1.3.5.md index badfa89d..d96ad974 100644 --- a/docs/changelogs/CHANGELOG.v1.3.5.md +++ b/docs/changelogs/CHANGELOG.v1.3.5.md @@ -13,5 +13,5 @@ QQ Version: Windows 9.9.9-23424 / Linux 3.2.7-23361 * 支持WebUi热重载 * 新增启动输出WEBUI秘钥 * 新增群荣誉信息 /get_group_honor_info - +* 支持获取群系统消息 /get_group_system_msg 新增的 API 详细见[API文档](https://napneko.github.io/zh-CN/develop/extends_api) \ No newline at end of file diff --git a/src/core b/src/core index 05984799..00d059a8 160000 --- a/src/core +++ b/src/core @@ -1 +1 @@ -Subproject commit 0598479976865832fda37b133a3556fd94d8f48c +Subproject commit 00d059a88e1fb3dffc7c27e2940027a2a6c14942 diff --git a/src/onebot11/action/group/GetGroupSystemMsg.ts b/src/onebot11/action/group/GetGroupSystemMsg.ts index 5341b032..b0cc72da 100644 --- a/src/onebot11/action/group/GetGroupSystemMsg.ts +++ b/src/onebot11/action/group/GetGroupSystemMsg.ts @@ -3,6 +3,7 @@ import BaseAction from '../BaseAction'; import { ActionName } from '../types'; import { NTQQMsgApi } from '@/core/apis/msg'; import { FromSchema, JSONSchema } from 'json-schema-to-ts'; +import { uid2UinMap } from '@/core/data'; const SchemaData = { type: 'object', @@ -17,6 +18,34 @@ export class GetGroupSystemMsg extends BaseAction { actionName = ActionName.GetGroupSystemMsg; protected async _handle(payload: void) { // 默认10条 该api未完整实现 包括响应数据规范化 类型规范化 - return await NTQQGroupApi.getSingleScreenNotifies(10); + let SingleScreenNotifies = await NTQQGroupApi.getSingleScreenNotifies(10); + let retData: any = { InvitedRequest: [], join_requests: [] }; + //console.log(SingleScreenNotifies); + + for (const SSNotify of SingleScreenNotifies) { + if (SSNotify.type == 1) { + retData.InvitedRequest.push({ + request_id: SSNotify.seq, + invitor_uin: uid2UinMap[SSNotify.user1?.uid], + invitor_nick: SSNotify.user1?.nickName, + group_id: SSNotify.group?.groupCode, + group_name: SSNotify.group?.groupName, + checked: SSNotify.status === 1 ? false : true, + actor: uid2UinMap[SSNotify.user2?.uid] || 0, + }); + } else if (SSNotify.type == 7) { + retData.join_requests.push({ + request_id: SSNotify.seq, + requester_uin: uid2UinMap[SSNotify.user1?.uid], + requester_nick: SSNotify.user1?.nickName, + group_id: SSNotify.group?.groupCode, + group_name: SSNotify.group?.groupName, + checked: SSNotify.status === 1 ? false : true, + actor: uid2UinMap[SSNotify.user2?.uid] || 0, + }); + } + } + + return retData; } }