mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-07-19 12:03:37 +00:00
chore: DownloadRichMedia
This commit is contained in:
@@ -141,16 +141,26 @@ export class NTQQFileApi {
|
|||||||
filePath: thumbPath,
|
filePath: thumbPath,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
let filePath = data[1].filePath;
|
let msg = await this.core.apis.MsgApi.getMsgsByMsgId({
|
||||||
if (filePath.startsWith('\\')) {
|
guildId: '',
|
||||||
// log('filePath start with \\');
|
chatType: chatType,
|
||||||
// Mlikiowa V2.0.0 Refactor Todo
|
peerUid: peerUid,
|
||||||
//const downloadPath = sessionConfig.defaultFileDownloadPath;
|
}, [msgId]);
|
||||||
//logDebug('downloadPath', downloadPath);
|
if (msg.msgList.length === 0) {
|
||||||
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
return data[1].filePath;
|
||||||
filePath = path.join('', filePath);
|
|
||||||
// 下载路径是下载文件夹的相对路径
|
|
||||||
}
|
}
|
||||||
|
//获取原始消息
|
||||||
|
let FileElements = msg?.msgList[0]?.elements?.find(e => e.elementId === elementId);
|
||||||
|
if (!FileElements) {
|
||||||
|
//失败则就乱来 Todo
|
||||||
|
return data[1].filePath;
|
||||||
|
}
|
||||||
|
//从原始消息获取文件路径
|
||||||
|
let filePath =
|
||||||
|
FileElements?.fileElement?.filePath ||
|
||||||
|
FileElements?.pttElement?.filePath ||
|
||||||
|
FileElements?.videoElement?.filePath ||
|
||||||
|
FileElements?.picElement?.sourcePath;
|
||||||
return filePath;
|
return filePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user