mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-21 09:36:35 +00:00
fix: TipGroupElementType
This commit is contained in:
parent
e5b063accb
commit
cd212abd5f
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user