From ea9e88a18a99c4f41e7f15050fcf45e5b1d44ee3 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: Thu, 26 Sep 2024 15:31:50 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=B8=8D=E5=8F=AF=E6=8A=97=E5=8A=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/log.ts | 12 +++++------- src/onebot/api/msg.ts | 4 ++-- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/common/log.ts b/src/common/log.ts index 1154321a..99b989e3 100644 --- a/src/common/log.ts +++ b/src/common/log.ts @@ -139,9 +139,8 @@ export class LogWrapper { logMessage(msg: RawMessage, selfInfo: SelfInfo) { const isSelfSent = msg.senderUin === selfInfo.uin; - this.log(`${ - isSelfSent ? '发送 ->' : '接收 <-' - } ${rawMessageToText(msg)}`); + this.log(`${isSelfSent ? '发送 ->' : '接收 <-' + } ${rawMessageToText(msg)}`); } } @@ -180,13 +179,12 @@ export function rawMessageToText(msg: RawMessage, recursiveLevel = 0): string { const recordMsgOrNull = msg.records.find( record => element.replyElement!.sourceMsgIdInRecords === record.msgId, ); - return `[回复消息 ${ - recordMsgOrNull && - recordMsgOrNull.peerUin != '284840486' // 非转发消息; 否则定位不到 + return `[回复消息 ${recordMsgOrNull && + recordMsgOrNull.peerUin != '284840486' && recordMsgOrNull.peerUin != '1094950020'// 非转发消息; 否则定位不到 ? rawMessageToText(recordMsgOrNull, recursiveLevel + 1) : `未找到消息记录 (MsgId = ${element.replyElement.sourceMsgIdInRecords})` - }]`; + }]`; } if (element.picElement) { diff --git a/src/onebot/api/msg.ts b/src/onebot/api/msg.ts index e77e652b..73cffa13 100644 --- a/src/onebot/api/msg.ts +++ b/src/onebot/api/msg.ts @@ -212,7 +212,7 @@ export class OneBotMsgApi { }, }); - if (records.peerUin === '284840486') { + if (records.peerUin === '284840486' || records.peerUin === '1094950020') { return createReplyData(records.msgId); } const replyMsg = (await this.core.apis.MsgApi.queryMsgsWithFilterExWithSeqV2(peer, element.replayMsgSeq, element.replyMsgTime, [element.senderUidStr])) @@ -234,7 +234,7 @@ export class OneBotMsgApi { //读取视频链接并兜底 let videoUrlWrappers: Awaited> | undefined; - if (msg.peerUin === '284840486') { + if (msg.peerUin === '284840486' || msg.peerUin === '1094950020') { //TODO: 合并消息内部 应该进行特殊处理 可能需要重写peer 待测试与研究 Mlikiowa Tagged } try {