fix: TipGroupElementType

This commit is contained in:
手瓜一十雪 2024-11-21 14:10:52 +08:00
parent e5b063accb
commit cd212abd5f
2 changed files with 16 additions and 7 deletions

View File

@ -361,9 +361,17 @@ export interface TipAioOpGrayTipElement {
*
*/
export enum TipGroupElementType {
memberIncrease = 1,
kicked = 3, // 被移出群
ban = 8
KUNKNOWN = 0,
KMEMBERADD = 1,
KDISBANDED = 2,
KQUITTE = 3,
KCREATED = 4,
KGROUPNAMEMODIFIED = 5,
KBLOCK = 6,
KUNBLOCK = 7,
KSHUTUP = 8,
KBERECYCLED = 9,
KDISBANDORBERECYCLED = 10
}
/**
@ -380,11 +388,12 @@ export enum MemberAddShowType {
K_YOU_ALREADY_MEMBER = 8,
K_YOU_INVITE_OTHER = 7,
}
/**
*
*/
export interface TipGroupElement {
type: TipGroupElementType; // 1表示有人加入群; 自己加入群也会收到这个
type: TipGroupElementType;
role: 0;
groupName: string;
memberUid: string;

View File

@ -50,13 +50,13 @@ export class OneBotGroupApi {
for (const element of msg.elements) {
if (element.grayTipElement?.groupElement) {
const groupElement = element.grayTipElement.groupElement;
if (groupElement.type == TipGroupElementType.memberIncrease) {
if (groupElement.type == TipGroupElementType.KMEMBERADD) {
const MemberIncreaseEvent = await this.obContext.apis.GroupApi.parseGroupMemberIncreaseEvent(msg.peerUid, element.grayTipElement);
if (MemberIncreaseEvent) return MemberIncreaseEvent;
} else if (groupElement.type === TipGroupElementType.ban) {
} else if (groupElement.type === TipGroupElementType.KSHUTUP) {
const BanEvent = await this.obContext.apis.GroupApi.parseGroupBanEvent(msg.peerUid, element.grayTipElement);
if (BanEvent) return BanEvent;
} else if (groupElement.type == TipGroupElementType.kicked) {
} else if (groupElement.type == TipGroupElementType.KQUITTE) {
this.core.apis.GroupApi.quitGroup(msg.peerUid).then();
try {
const KickEvent = await this.obContext.apis.GroupApi.parseGroupKickEvent(msg.peerUid, element.grayTipElement);