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.
This commit is contained in:
手瓜一十雪 2025-11-12 12:54:09 +08:00
parent 54cacc30e4
commit c9b45ec1a2

View File

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