fix(onebot): get_group_files_by_folder 不再丢弃子文件夹 (#2095)

该接口的 returnSchema 声明了 folders(文件夹列表),actionDescription
也写着「获取指定群文件夹下的文件及子文件夹列表」,但 _handle 把 folders
硬编码成空数组。

它调用的 MsgApi.getGroupFileList 与 get_group_root_files 相同,返回项
既可能带 fileInfo 也可能带 folderInfo;兄弟实现 GetGroupRootFiles 把
两类都映射了出来。后果是进入某个子目录后无法继续往下遍历,调用方永远
只能拿到空的 folders。

改为按兄弟接口的方式映射 folderInfo。
This commit is contained in:
Shxiao authored and GitHub committed 2026-10-07 22:05:51 +08:00
1 parent f750d95545
commit 05feca9a2c
2 files changed
+69 -1

No files matched your search

@@ -43,7 +43,8 @@ export class GetGroupFilesByFolder extends OneBotAction<PayloadType, ReturnType>
return {
files: ret.filter(item => item.fileInfo)
.map(item => OB11Construct.file(item.peerId, item.fileInfo!)),
folders: [],
folders: ret.filter(item => item.folderInfo)
.map(item => OB11Construct.folder(item.peerId, item.folderInfo!)),
};
}
}