mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-21 09:36:35 +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 NTQQMsgApi = this.core.apis.MsgApi;
|
||||||
const NTQQFileApi = this.core.apis.FileApi;
|
const NTQQFileApi = this.core.apis.FileApi;
|
||||||
|
|
||||||
const contextMsgFile = FileNapCatOneBotUUID.decode(payload.file);
|
|
||||||
//接收消息标记模式
|
//接收消息标记模式
|
||||||
|
const contextMsgFile = FileNapCatOneBotUUID.decode(payload.file);
|
||||||
if (contextMsgFile) {
|
if (contextMsgFile) {
|
||||||
const { peer, msgId, elementId } = contextMsgFile;
|
const { peer, msgId, elementId } = contextMsgFile;
|
||||||
const downloadPath = await NTQQFileApi.downloadMedia(msgId, peer.chatType, peer.peerUid, elementId, '', '');
|
const downloadPath = await NTQQFileApi.downloadMedia(msgId, peer.chatType, peer.peerUid, elementId, '', '');
|
||||||
@ -59,6 +59,7 @@ export class GetFileBase extends BaseAction<GetFilePayload, GetFileResponse> {
|
|||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
//群文件模式
|
//群文件模式
|
||||||
const contextModelIdFile = FileNapCatOneBotUUID.decodeModelId(payload.file);
|
const contextModelIdFile = FileNapCatOneBotUUID.decodeModelId(payload.file);
|
||||||
if (contextModelIdFile) {
|
if (contextModelIdFile) {
|
||||||
|
@ -80,7 +80,7 @@ export class OneBotGroupApi {
|
|||||||
id: FileNapCatOneBotUUID.encode({
|
id: FileNapCatOneBotUUID.encode({
|
||||||
chatType: ChatType.KCHATTYPEGROUP,
|
chatType: ChatType.KCHATTYPEGROUP,
|
||||||
peerUid: msg.peerUid,
|
peerUid: msg.peerUid,
|
||||||
}, msg.msgSeq, element.elementId),
|
}, msg.msgId, element.elementId),
|
||||||
name: element.fileElement.fileName,
|
name: element.fileElement.fileName,
|
||||||
size: parseInt(element.fileElement.fileSize),
|
size: parseInt(element.fileElement.fileSize),
|
||||||
busid: element.fileElement.fileBizId || 0,
|
busid: element.fileElement.fileBizId || 0,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user