mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-12 16:00:27 +00:00
refactor: rewrite switch with object mapping or if-else
This commit is contained in:
@@ -139,8 +139,7 @@ export class OneBotGroupApi {
|
||||
}
|
||||
if (element.grayTipElement.jsonGrayTipElement.busiId == 2407) {
|
||||
const type = json.items[json.items.length - 1]?.txt;
|
||||
switch (type) {
|
||||
case "头衔": {
|
||||
if (type === "头衔") {
|
||||
const memberUin = json.items[1].param[0];
|
||||
const title = json.items[3].txt;
|
||||
logger.logDebug('收到群成员新头衔消息', json);
|
||||
@@ -150,11 +149,10 @@ export class OneBotGroupApi {
|
||||
parseInt(memberUin),
|
||||
title,
|
||||
);
|
||||
}
|
||||
case "移出":
|
||||
} else if (type === "移出") {
|
||||
logger.logDebug('收到机器人被踢消息', json);
|
||||
return;
|
||||
default:
|
||||
} else {
|
||||
logger.logWarn('收到未知的灰条消息', json);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user