mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-16 04:45:46 +00:00
fix: get file by msgId and elemId
This commit is contained in:
parent
f5e7288fe5
commit
92f8eaaac9
@ -31,8 +31,8 @@ export class GetFileBase extends BaseAction<GetFilePayload, GetFileResponse> {
|
||||
const NTQQMsgApi = this.core.apis.MsgApi;
|
||||
const NTQQFileApi = this.core.apis.FileApi;
|
||||
|
||||
const contextMsgFile = FileNapCatOneBotUUID.decode(payload.file);
|
||||
//接收消息标记模式
|
||||
const contextMsgFile = FileNapCatOneBotUUID.decode(payload.file);
|
||||
if (contextMsgFile) {
|
||||
const { peer, msgId, elementId } = contextMsgFile;
|
||||
const downloadPath = await NTQQFileApi.downloadMedia(msgId, peer.chatType, peer.peerUid, elementId, '', '');
|
||||
@ -59,6 +59,7 @@ export class GetFileBase extends BaseAction<GetFilePayload, GetFileResponse> {
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
//群文件模式
|
||||
const contextModelIdFile = FileNapCatOneBotUUID.decodeModelId(payload.file);
|
||||
if (contextModelIdFile) {
|
||||
|
@ -80,7 +80,7 @@ export class OneBotGroupApi {
|
||||
id: FileNapCatOneBotUUID.encode({
|
||||
chatType: ChatType.KCHATTYPEGROUP,
|
||||
peerUid: msg.peerUid,
|
||||
}, msg.msgSeq, element.elementId),
|
||||
}, msg.msgId, element.elementId),
|
||||
name: element.fileElement.fileName,
|
||||
size: parseInt(element.fileElement.fileSize),
|
||||
busid: element.fileElement.fileBizId || 0,
|
||||
|
Loading…
Reference in New Issue
Block a user