From 68e86b07c78e721b460df53773eceddd34c5bdbe 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: Tue, 19 Nov 2024 16:29:33 +0800 Subject: [PATCH] fix: #543 --- src/onebot/index.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/onebot/index.ts b/src/onebot/index.ts index ca86f059..5b99d993 100644 --- a/src/onebot/index.ts +++ b/src/onebot/index.ts @@ -577,15 +577,16 @@ export class NapCatOneBot11Adapter { private createMsgMap(network: Array, ob11Msg: any, isSelfMsg: boolean, message: RawMessage): Map { const msgMap: Map = new Map(); network.filter(e => e.enable).forEach(e => { + if (isSelfMsg) { + ob11Msg.stringMsg.target_id = parseInt(message.peerUin); + ob11Msg.arrayMsg.target_id = parseInt(message.peerUin); + } if (e.messagePostFormat == 'string') { msgMap.set(e.name, structuredClone(ob11Msg.stringMsg)); } else { msgMap.set(e.name, structuredClone(ob11Msg.arrayMsg)); } - if (isSelfMsg) { - ob11Msg.stringMsg.target_id = parseInt(message.peerUin); - ob11Msg.arrayMsg.target_id = parseInt(message.peerUin); - } + }); return msgMap; }