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; }