refactor: msgId stage-2
This commit is contained in:
1 parent
4f9fb2c8c3
commit
087c76b394
9 files changed
+22
-31
No files matched your search
@@ -17,6 +17,7 @@ import { uri2local } from '@/common/utils/file';
|
||||
import { ob11Config } from '@/onebot11/config';
|
||||
import { RequestUtil } from '@/common/utils/request';
|
||||
import fs from 'node:fs';
|
||||
import { MessageUnique } from '@/common/utils/MessageUnique';
|
||||
|
||||
export type MessageContext = {
|
||||
group?: Group,
|
||||
@@ -36,10 +37,10 @@ async function handleOb11FileLikeMessage(
|
||||
} else if (cache.url) {
|
||||
uri = cache.url;
|
||||
} else {
|
||||
const fileMsg = await dbUtil.getMsgByLongId(cache.msgId);
|
||||
if (fileMsg) {
|
||||
const fileMsgPeer = MessageUnique.getPeerByMsgId(cache.msgId);
|
||||
if (fileMsgPeer) {
|
||||
cache.path = await NTQQFileApi.downloadMedia(
|
||||
fileMsg.msgId, fileMsg.chatType, fileMsg.peerUid,
|
||||
fileMsgPeer.MsgId, fileMsgPeer.Peer.chatType, fileMsgPeer.Peer.peerUid,
|
||||
cache.elementId, '', ''
|
||||
);
|
||||
uri = 'file://' + cache.path;
|
||||
|
||||
Reference in new issue
Block a user