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,
|
||||
},
|
||||
);
|
||||
let filePath = data[1].filePath;
|
||||
if (filePath.startsWith('\\')) {
|
||||
// log('filePath start with \\');
|
||||
// Mlikiowa V2.0.0 Refactor Todo
|
||||
//const downloadPath = sessionConfig.defaultFileDownloadPath;
|
||||
//logDebug('downloadPath', downloadPath);
|
||||
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
filePath = path.join('', filePath);
|
||||
// 下载路径是下载文件夹的相对路径
|
||||
let msg = await this.core.apis.MsgApi.getMsgsByMsgId({
|
||||
guildId: '',
|
||||
chatType: chatType,
|
||||
peerUid: peerUid,
|
||||
}, [msgId]);
|
||||
if (msg.msgList.length === 0) {
|
||||
return data[1].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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user