From 617592d90a3e139acba5ca552f702c8358e6bb67 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 11:32:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=A4=9A=E6=AC=A1post?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/onebot11/main.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/onebot11/main.ts b/src/onebot11/main.ts index b3cdd705..2beca62a 100644 --- a/src/onebot11/main.ts +++ b/src/onebot11/main.ts @@ -241,14 +241,20 @@ export class NapCatOnebot11 { msgListener.onMsgInfoListUpdate = (msgList) => { this.postRecallMsg(msgList).then().catch(logError); for (const msg of msgList.filter(e => e.senderUin == selfInfo.uin)) { + // console.log(msg); + if (msg.sendStatus !== 2) { + //完成后再post + return; + } OB11Constructor.message(msg).then((_msg) => { _msg.target_id = parseInt(msg.peerUin); - logMessage(_msg as OB11Message).then().catch(logError); + if (ob11Config.reportSelfMessage) { + msg.id = MessageUnique.createMsg({ chatType: msg.chatType, peerUid: msg.peerUid, guildId: '' }, msg.msgId); + this.postReceiveMsg([msg]).then().catch(logError); + } else { + logMessage(_msg as OB11Message).then().catch(logError); + } }).catch(logError); - if (ob11Config.reportSelfMessage) { - msg.id = MessageUnique.createMsg({ chatType: msg.chatType, peerUid: msg.peerUid, guildId: '' }, msg.msgId); - this.postReceiveMsg([msg]).then().catch(logError); - } } }; msgListener.onAddSendMsg = (msg) => {