diff --git a/packages/napcat-core/apis/group.ts b/packages/napcat-core/apis/group.ts index 3400a9d98..93b34fb09 100644 --- a/packages/napcat-core/apis/group.ts +++ b/packages/napcat-core/apis/group.ts @@ -430,6 +430,24 @@ export class NTQQGroupApi { return this.context.session.getRichMediaService().batchGetGroupFileCount(groupCodes); } + // getGroupFileList also carries the group's used/total space in its call + // result's `groupSpaceResult`; a single-item fetch is enough to read it. + async getGroupFileSpace (groupCode: string) { + const [result] = await this.core.eventWrapper.callNormalEventV2( + 'NodeIKernelRichMediaService/getGroupFileList', + 'NodeIKernelMsgListener/onGroupFileInfoUpdate', + [ + groupCode, + { sortType: 1, fileCount: 1, startIndex: 0, sortOrder: 1, showOnlinedocFolder: 0 }, + ], + () => true, + () => true, + 1, + 5000 + ); + return result?.groupSpaceResult; + } + async getArkJsonGroupShare (groupCode: string) { const ret = await this.core.eventWrapper.callNoListenerEvent( 'NodeIKernelGroupService/getGroupRecommendContactArkJson', diff --git a/packages/napcat-onebot/action/go-cqhttp/GetGroupFileSystemInfo.ts b/packages/napcat-onebot/action/go-cqhttp/GetGroupFileSystemInfo.ts index 1a01b61e9..25bc476b7 100644 --- a/packages/napcat-onebot/action/go-cqhttp/GetGroupFileSystemInfo.ts +++ b/packages/napcat-onebot/action/go-cqhttp/GetGroupFileSystemInfo.ts @@ -29,15 +29,22 @@ export class GetGroupFileSystemInfo extends OneBotAction