mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-07-19 12:03:37 +00:00
fix: 多次上报自身消息
This commit is contained in:
@@ -242,19 +242,19 @@ export class NapCatOnebot11 {
|
|||||||
this.postRecallMsg(msgList).then().catch(logError);
|
this.postRecallMsg(msgList).then().catch(logError);
|
||||||
for (const msg of msgList.filter(e => e.senderUin == selfInfo.uin)) {
|
for (const msg of msgList.filter(e => e.senderUin == selfInfo.uin)) {
|
||||||
// console.log(msg);
|
// console.log(msg);
|
||||||
if (msg.sendStatus !== 2) {
|
if (msg.sendStatus == 2) {
|
||||||
//完成后再post
|
//完成后再post
|
||||||
return;
|
OB11Constructor.message(msg).then((_msg) => {
|
||||||
|
_msg.target_id = parseInt(msg.peerUin);
|
||||||
|
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);
|
||||||
}
|
}
|
||||||
OB11Constructor.message(msg).then((_msg) => {
|
|
||||||
_msg.target_id = parseInt(msg.peerUin);
|
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
msgListener.onAddSendMsg = (msg) => {
|
msgListener.onAddSendMsg = (msg) => {
|
||||||
|
Reference in New Issue
Block a user