Merge pull request #352 from cnxysoft/upmain

fix: 踢官方机器人报错
This commit is contained in:
Alen 2024-09-10 00:40:58 +08:00 committed by GitHub
commit f6da7da90b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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