From 6c46cdd94793926f0868b146701f3ea9b45d97ae 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: Sun, 17 Nov 2024 11:33:01 +0800 Subject: [PATCH] fix: error --- src/onebot/index.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/onebot/index.ts b/src/onebot/index.ts index 8e5a9f5f..ca86f059 100644 --- a/src/onebot/index.ts +++ b/src/onebot/index.ts @@ -545,6 +545,11 @@ export class NapCatOneBot11Adapter { private async emitMsg(message: RawMessage) { const network = Object.values(this.configLoader.configData.network).flat() as Array; this.context.logger.logDebug('收到新消息 RawMessage', message); + await this.handleMsg(message, network); + await this.handleGroupEvent(message); + await this.handlePrivateMsgEvent(message); + } + private async handleMsg(message: RawMessage, network: Array) { try { const ob11Msg = await this.apis.MsgApi.parseMessageV2(message); if (ob11Msg) { @@ -559,11 +564,8 @@ export class NapCatOneBot11Adapter { } catch (e) { this.context.logger.logError('constructMessage error: ', e); } - - this.handleGroupEvent(message); - this.handlePrivateMsgEvent(message); } - + private isSelfMessage(ob11Msg: { stringMsg: OB11Message; arrayMsg: OB11Message;