fix: 删除旧文件

This commit is contained in:
手瓜一十雪 2024-09-12 18:15:38 +08:00
parent 1db9bb419d
commit 911e4921e2

View File

@ -148,7 +148,8 @@ export class NTQQFileApi {
logger.logError('获取视频信息失败,将使用默认值', e);
}
const newFilePath = filePath + '.mp4';
fs.renameSync(filePath, newFilePath);
fs.copyFileSync(filePath, newFilePath);
context.deleteAfterSentFiles.push(newFilePath);
filePath = newFilePath;
const { fileName: _fileName, path, fileSize, md5 } = await this.core.apis.FileApi.uploadFile(filePath, ElementType.VIDEO);
if (fileSize === 0) {