fix: modelId

This commit is contained in:
手瓜一十雪
2024-08-29 20:34:24 +08:00
parent 1c288d9a6f
commit f12375ed8c
4 changed files with 16 additions and 5 deletions

View File

@@ -64,7 +64,7 @@ export class GetFileBase extends BaseAction<GetFilePayload, GetFileResponse> {
const contextModelIdFile = FileNapCatOneBotUUID.decodeModelId(payload.file);
if (contextModelIdFile) {
const { peer, modelId } = contextModelIdFile;
const downloadPath = await NTQQFileApi.downloadFileForModelId(peer, modelId);
const downloadPath = await NTQQFileApi.downloadFileForModelId(peer, modelId,' ');
const res: GetFileResponse = {
file: downloadPath,
url: downloadPath,

View File

@@ -1,6 +1,7 @@
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
import BaseAction from '../BaseAction';
import { ActionName } from '../types';
import { FileNapCatOneBotUUID } from '@/common/helper';
const SchemaData = {
type: 'object',
@@ -37,6 +38,13 @@ export class GetGroupFileList extends BaseAction<Payload, { FileList: Array<any>
}).catch((e) => {
return [];
});
ret.forEach((e) => {
let fileModelId = e?.fileInfo?.fileModelId;
if (fileModelId) {
e.fileModelId = fileModelId;
}
e.fileId = FileNapCatOneBotUUID.encodeModelId({ chatType: 2, peerUid: payload.group_id.toString() }, fileModelId);
});
return { FileList: ret };
}
}