fix: 不可抗力

This commit is contained in:
手瓜一十雪 2024-09-26 15:31:50 +08:00
parent fcf8139afe
commit ea9e88a18a
2 changed files with 7 additions and 9 deletions

View File

@ -139,9 +139,8 @@ export class LogWrapper {
logMessage(msg: RawMessage, selfInfo: SelfInfo) { logMessage(msg: RawMessage, selfInfo: SelfInfo) {
const isSelfSent = msg.senderUin === selfInfo.uin; const isSelfSent = msg.senderUin === selfInfo.uin;
this.log(`${ this.log(`${isSelfSent ? '发送 ->' : '接收 <-'
isSelfSent ? '发送 ->' : '接收 <-' } ${rawMessageToText(msg)}`);
} ${rawMessageToText(msg)}`);
} }
} }
@ -180,13 +179,12 @@ export function rawMessageToText(msg: RawMessage, recursiveLevel = 0): string {
const recordMsgOrNull = msg.records.find( const recordMsgOrNull = msg.records.find(
record => element.replyElement!.sourceMsgIdInRecords === record.msgId, record => element.replyElement!.sourceMsgIdInRecords === record.msgId,
); );
return `[回复消息 ${ return `[回复消息 ${recordMsgOrNull &&
recordMsgOrNull && recordMsgOrNull.peerUin != '284840486' && recordMsgOrNull.peerUin != '1094950020'// 非转发消息; 否则定位不到
recordMsgOrNull.peerUin != '284840486' // 非转发消息; 否则定位不到
? ?
rawMessageToText(recordMsgOrNull, recursiveLevel + 1) : rawMessageToText(recordMsgOrNull, recursiveLevel + 1) :
`未找到消息记录 (MsgId = ${element.replyElement.sourceMsgIdInRecords})` `未找到消息记录 (MsgId = ${element.replyElement.sourceMsgIdInRecords})`
}]`; }]`;
} }
if (element.picElement) { if (element.picElement) {

View File

@ -212,7 +212,7 @@ export class OneBotMsgApi {
}, },
}); });
if (records.peerUin === '284840486') { if (records.peerUin === '284840486' || records.peerUin === '1094950020') {
return createReplyData(records.msgId); return createReplyData(records.msgId);
} }
const replyMsg = (await this.core.apis.MsgApi.queryMsgsWithFilterExWithSeqV2(peer, element.replayMsgSeq, element.replyMsgTime, [element.senderUidStr])) 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<ReturnType<typeof this.core.apis.FileApi.getVideoUrl>> | undefined; let videoUrlWrappers: Awaited<ReturnType<typeof this.core.apis.FileApi.getVideoUrl>> | undefined;
if (msg.peerUin === '284840486') { if (msg.peerUin === '284840486' || msg.peerUin === '1094950020') {
//TODO: 合并消息内部 应该进行特殊处理 可能需要重写peer 待测试与研究 Mlikiowa Tagged //TODO: 合并消息内部 应该进行特殊处理 可能需要重写peer 待测试与研究 Mlikiowa Tagged
} }
try { try {