mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-12-19 13:10:16 +08:00
Refactor busiId type and comparisons in group API
Changed the type of jsonGrayTipElement.busiId to always be a string in element types. Updated related group API logic to compare busiId as a string directly, improving type consistency and reducing unnecessary conversions.
This commit is contained in:
parent
79fa0ade0d
commit
e0ec4d4ebb
@ -88,7 +88,7 @@ export interface GrayTipElement {
|
|||||||
templId: string;
|
templId: string;
|
||||||
};
|
};
|
||||||
jsonGrayTipElement: {
|
jsonGrayTipElement: {
|
||||||
busiId?: number | string;
|
busiId: string;
|
||||||
jsonStr: string;
|
jsonStr: string;
|
||||||
recentAbstract?: string;
|
recentAbstract?: string;
|
||||||
isServer?: boolean;
|
isServer?: boolean;
|
||||||
|
|||||||
@ -351,11 +351,11 @@ export class OneBotGroupApi {
|
|||||||
}
|
}
|
||||||
} else if (grayTipElement.subElementType === NTGrayTipElementSubTypeV2.GRAYTIP_ELEMENT_SUBTYPE_JSON) {
|
} else if (grayTipElement.subElementType === NTGrayTipElementSubTypeV2.GRAYTIP_ELEMENT_SUBTYPE_JSON) {
|
||||||
// 解析json事件 busiId好像是string类型的?
|
// 解析json事件 busiId好像是string类型的?
|
||||||
if (grayTipElement.jsonGrayTipElement.busiId?.toString() === '1061') {
|
if (grayTipElement.jsonGrayTipElement.busiId === '1061') {
|
||||||
return await this.parsePaiYiPai(msg, grayTipElement.jsonGrayTipElement.jsonStr);
|
return await this.parsePaiYiPai(msg, grayTipElement.jsonGrayTipElement.jsonStr);
|
||||||
} else if (grayTipElement.jsonGrayTipElement.busiId === JsonGrayBusiId.AIO_GROUP_ESSENCE_MSG_TIP) {
|
} else if (grayTipElement.jsonGrayTipElement.busiId === JsonGrayBusiId.AIO_GROUP_ESSENCE_MSG_TIP.toString()) {
|
||||||
return await this.parseEssenceMsg(msg, grayTipElement.jsonGrayTipElement.jsonStr);
|
return await this.parseEssenceMsg(msg, grayTipElement.jsonGrayTipElement.jsonStr);
|
||||||
} else if ((grayTipElement.jsonGrayTipElement.busiId ?? 0).toString() === '51') {
|
} else if (grayTipElement.jsonGrayTipElement.busiId === '51') {
|
||||||
// 51是什么?{"align":"center","items":[{"txt":"下一秒起床通过王者荣耀加入群","type":"nor"}]
|
// 51是什么?{"align":"center","items":[{"txt":"下一秒起床通过王者荣耀加入群","type":"nor"}]
|
||||||
return await this.parse51TypeEvent(msg, grayTipElement);
|
return await this.parse51TypeEvent(msg, grayTipElement);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user