From 7f9da8cc2dc45418a0027c61296e14e149b5c2cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=89=8B=E7=93=9C=E4=B8=80=E5=8D=81=E9=9B=AA?= Date: Wed, 28 Aug 2024 21:19:17 +0800 Subject: [PATCH] feat: support folder_id --- src/onebot/action/file/GetGroupFileList.ts | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/onebot/action/file/GetGroupFileList.ts b/src/onebot/action/file/GetGroupFileList.ts index dbb7ff4f..40c12648 100644 --- a/src/onebot/action/file/GetGroupFileList.ts +++ b/src/onebot/action/file/GetGroupFileList.ts @@ -6,8 +6,9 @@ const SchemaData = { type: 'object', properties: { group_id: { type: ['string', 'number'] }, - start_index: { type: 'number' }, - file_count: { type: 'number' }, + start_index: { type: ['string', 'number'] }, + file_count: { type: ['string', 'number'] }, + folder_id: { type: ['string', 'number'] }, }, required: ['group_id', 'start_index', 'file_count'], } as const satisfies JSONSchema; @@ -20,12 +21,19 @@ export class GetGroupFileList extends BaseAction async _handle(payload: Payload) { const NTQQMsgApi = this.core.apis.MsgApi; + let param = {}; + if (payload.folder_id) { + param = { + folderId: payload.folder_id.toString(), + }; + } const ret = await NTQQMsgApi.getGroupFileList(payload.group_id.toString(), { sortType: 1, - fileCount: payload.file_count, - startIndex: payload.start_index, + fileCount: +payload.file_count, + startIndex: +payload.start_index, sortOrder: 2, showOnlinedocFolder: 0, + ...param }).catch((e) => { return []; });