From a745185408c190af4ea4abecc2ced62a7c435752 Mon Sep 17 00:00:00 2001 From: Alen Date: Tue, 10 Sep 2024 00:38:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=B8=A2=E5=AE=98=E6=96=B9=E6=9C=BA?= =?UTF-8?q?=E5=99=A8=E4=BA=BA=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/onebot/api/group.ts | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/src/onebot/api/group.ts b/src/onebot/api/group.ts index 0786674f..8e6f9499 100644 --- a/src/onebot/api/group.ts +++ b/src/onebot/api/group.ts @@ -140,15 +140,25 @@ export class OneBotGroupApi { } if (element.grayTipElement.jsonGrayTipElement.busiId == 2407) { //下面得改 上面也是错的grayTipElement.subElementType == GrayTipElementSubType.MEMBER_NEW_TITLE - const memberUin = json.items[1].param[0]; - const title = json.items[3].txt; - logger.logDebug('收到群成员新头衔消息', json); - return new OB11GroupTitleEvent( - this.core, - parseInt(msg.peerUid), - parseInt(memberUin), - title, - ); + const type = json.items[json.items.length - 1]?.txt; + switch (type) { + case "头衔": { + const memberUin = json.items[1].param[0]; + const title = json.items[3].txt; + logger.logDebug('收到群成员新头衔消息', json); + return new OB11GroupTitleEvent( + this.core, + parseInt(msg.peerUid), + parseInt(memberUin), + title, + ); + }; + case "移出": + logger.logDebug('收到机器人被踢消息', json); + return; + default: + logger.logWarn('收到未知的灰条消息', json); + } } } }