From 66c1bab6294d419ff25aad89a969ed3ed4bd9ea6 Mon Sep 17 00:00:00 2001 From: Alen Date: Sun, 15 Sep 2024 16:47:46 +0800 Subject: [PATCH] fix: friend_add MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复该事件中user_id为0的问题 --- src/onebot/api/msg.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/onebot/api/msg.ts b/src/onebot/api/msg.ts index 7cfff9d5..c8090c0b 100644 --- a/src/onebot/api/msg.ts +++ b/src/onebot/api/msg.ts @@ -629,7 +629,7 @@ export class OneBotMsgApi { if (element.grayTipElement.subElementType == NTGrayTipElementSubTypeV2.GRAYTIP_ELEMENT_SUBTYPE_XMLMSG) { //好友添加成功事件 if (element.grayTipElement.xmlElement.templId === '10229' && msg.peerUin !== '') { - return new OB11FriendAddNoticeEvent(this.core, parseInt(msg.peerUin)); + return new OB11FriendAddNoticeEvent(this.core, parseInt(msg.peerUin) || Number(await this.core.apis.UserApi.getUinByUidV2(msg.peerUid))); } } }