From c9b45ec1a2cb8ac1aaa83530c1259388c206477c 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: Wed, 12 Nov 2025 12:54:09 +0800 Subject: [PATCH] Fix busiId comparison in parsePrivateMsgEvent Ensure busiId is compared as a string in parsePrivateMsgEvent to handle cases where busiId may not be a string type. This prevents potential mismatches due to type differences. --- src/onebot/api/msg.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/onebot/api/msg.ts b/src/onebot/api/msg.ts index a710c09e..efb72ed7 100644 --- a/src/onebot/api/msg.ts +++ b/src/onebot/api/msg.ts @@ -907,12 +907,12 @@ export class OneBotMsgApi { async parsePrivateMsgEvent (msg: RawMessage, grayTipElement: GrayTipElement) { if (grayTipElement.subElementType === NTGrayTipElementSubTypeV2.GRAYTIP_ELEMENT_SUBTYPE_JSON) { - if (grayTipElement.jsonGrayTipElement.busiId === 1061) { + if (grayTipElement.jsonGrayTipElement.busiId.toString() === '1061') { const PokeEvent = await this.obContext.apis.FriendApi.parsePrivatePokeEvent(grayTipElement, Number(await this.core.apis.UserApi.getUinByUidV2(msg.peerUid))); if (PokeEvent) { return PokeEvent; } - } else if (grayTipElement.jsonGrayTipElement.busiId === 19324 && msg.peerUid !== '') { + } else if (grayTipElement.jsonGrayTipElement.busiId.toString() === '19324' && msg.peerUid !== '') { return new OB11FriendAddNoticeEvent(this.core, Number(await this.core.apis.UserApi.getUinByUidV2(msg.peerUid))); } }