feat(onebot): implement rename_group_file (OIDB 0x6D6_4)

Add the file-rename slot to the group-file OIDB envelope (req/resp field 5),
a RenameGroupFile service mirroring MoveGroupFile, a groupFile.rename() api
method, and the rename_group_file action (params group_id/file_id/
current_parent_directory/new_name, NapCat-aligned), replacing the stub.
Wire fields (busId=102, parentFolder=current dir, newFileName) verified
against NapCat's Oidb.0x6D6 transformer; subCommand 4 cross-checked against
the move op (sub 5 on both sides). Serialize + envelope round-trip test locks
the pb tags.
This commit is contained in:
DrSmoothl committed 2026-06-18 00:19:00 +08:00
1 parent 0ba5eba31c
commit 07988629f1
8 files changed
+178 -9

No files matched your search

-9
View File
@@ -1029,15 +1029,6 @@ export const actions = [
},
}),
defineAction({
name: 'rename_group_file',
summary: '重命名群文件(未实现)',
params: {},
run: async () => {
return failedResponse(RETCODE.ACTION_FAILED, 'not yet implemented');
},
}),
// get_file — 统一文件信息入口。SnowLuma 按 file_id 解析媒体缓存:
// 先图片、后语音(两者已带 url 重签与 file_size/file_name)。
// 局限:群文件/普通文件的 file_id 无法在此解析——OneBot `get_file` 单参
+16
View File
@@ -100,6 +100,22 @@ export const actions = [
},
}),
// rename_group_file — 0x6D6_4。NapCat 入参:file_id + current_parent_directory
// (文件当前所在目录)+ new_name。SnowLuma 的 file_id 即原始 fileId,无需 UUID 解码。
groupAction({
name: 'rename_group_file',
summary: '重命名群文件',
params: {
file_id: f.string({ allowEmpty: false }),
current_parent_directory: f.string().default('/'),
new_name: f.string({ allowEmpty: false }),
},
run: async (p, ctx) => {
await ctx.bridge.apis.groupFile.rename(p.group_id, p.file_id, p.current_parent_directory || '/', p.new_name);
return okResponse({ ok: true });
},
}),
groupAction({
name: 'create_group_file_folder',
summary: '创建群文件夹',