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:
8 files changed
+178
-9
No files matched your search
@@ -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: '创建群文件夹',
|
||||
|
||||
Reference in new issue
Block a user