From 606eccd22b2401e104ee1862761212c9d0bb2faf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=89=8B=E7=93=9C=E4=B8=80=E5=8D=81=E9=9B=AA?= Date: Mon, 29 Jul 2024 10:12:41 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E7=B2=BE=E7=AE=80=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/src/apis/msg.ts | 6 +++--- src/onebot11/constructor.ts | 10 +--------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/core/src/apis/msg.ts b/src/core/src/apis/msg.ts index 25cd7883..45802fb1 100644 --- a/src/core/src/apis/msg.ts +++ b/src/core/src/apis/msg.ts @@ -103,11 +103,11 @@ export class NTQQMsgApi { static async fetchFavEmojiList(num: number) { return napCatCore.session.getMsgService().fetchFavEmojiList("", num, true, true) } - static async queryMsgsWithFilterExWithSeq(peer: Peer, msgSeq: string, msgTime: string, senderUid: string) { - let ret = await napCatCore.session.getMsgService().queryMsgsWithFilterEx('0', msgTime, msgSeq, { + static async queryMsgsWithFilterExWithSeq(peer: Peer, msgSeq: string) { + let ret = await napCatCore.session.getMsgService().queryMsgsWithFilterEx('0', '0', msgSeq, { chatInfo: peer, filterMsgType: [], - filterSendersUid: [senderUid], + filterSendersUid: [], filterMsgToTime: '0', filterMsgFromTime: '0', isReverseOrder: false, diff --git a/src/onebot11/constructor.ts b/src/onebot11/constructor.ts index 693a5a63..e1b543ef 100644 --- a/src/onebot11/constructor.ts +++ b/src/onebot11/constructor.ts @@ -150,16 +150,8 @@ export class OB11Constructor { guildId: '', }; let replyMsg: RawMessage | undefined; - + replyMsg = (await NTQQMsgApi.getMsgsBySeqAndCount({ peerUid: msg.peerUid, guildId: '', chatType: msg.chatType }, element.replyElement.replayMsgSeq, 1, true, true)).msgList[0]; - if (!replyMsg || element.replyElement.replayMsgSeq !== replyMsg.msgSeq) { - replyMsg = (await NTQQMsgApi.queryMsgsWithFilterExWithSeq( - peer, - element.replyElement.replayMsgSeq, - '0', - '0' - )).msgList[0]; - } if (!replyMsg || element.replyElement.replayMsgSeq !== replyMsg.msgSeq) { replyMsg = (await NTQQMsgApi.getSingleMsg(peer, element.replyElement.replayMsgSeq)).msgList[0]; }