mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-07-19 12:03:37 +00:00
增加抽象类,修改继承关系
This commit is contained in:
@@ -2,4 +2,5 @@ import { EventType, OneBotEvent } from '@/onebot/event/OneBotEvent';
|
|||||||
|
|
||||||
export abstract class OB11BaseNoticeEvent extends OneBotEvent {
|
export abstract class OB11BaseNoticeEvent extends OneBotEvent {
|
||||||
post_type = EventType.NOTICE;
|
post_type = EventType.NOTICE;
|
||||||
|
abstract notice_type: string;
|
||||||
}
|
}
|
6
src/onebot/event/request/OB11BaseRequestEvent.ts
Normal file
6
src/onebot/event/request/OB11BaseRequestEvent.ts
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
import { EventType, OneBotEvent } from '../OneBotEvent';
|
||||||
|
|
||||||
|
export abstract class OB11BaseRequestEvent extends OneBotEvent {
|
||||||
|
post_type = EventType.REQUEST;
|
||||||
|
abstract request_type: string;
|
||||||
|
}
|
@@ -1,9 +1,7 @@
|
|||||||
import { OB11BaseNoticeEvent } from '@/onebot/event/notice/OB11BaseNoticeEvent';
|
|
||||||
import { EventType } from '@/onebot/event/OneBotEvent';
|
|
||||||
import { NapCatCore } from '@/core';
|
import { NapCatCore } from '@/core';
|
||||||
|
import { OB11BaseRequestEvent } from './OB11BaseRequestEvent';
|
||||||
|
|
||||||
export class OB11FriendRequestEvent extends OB11BaseNoticeEvent {
|
export class OB11FriendRequestEvent extends OB11BaseRequestEvent {
|
||||||
override post_type = EventType.REQUEST;
|
|
||||||
request_type = 'friend';
|
request_type = 'friend';
|
||||||
|
|
||||||
user_id: number;
|
user_id: number;
|
||||||
|
@@ -1,18 +1,18 @@
|
|||||||
import { OB11GroupNoticeEvent } from '@/onebot/event/notice/OB11GroupNoticeEvent';
|
|
||||||
import { EventType } from '@/onebot/event/OneBotEvent';
|
|
||||||
import { NapCatCore } from '@/core';
|
import { NapCatCore } from '@/core';
|
||||||
|
import { OB11BaseRequestEvent } from './OB11BaseRequestEvent';
|
||||||
|
|
||||||
export class OB11GroupRequestEvent extends OB11GroupNoticeEvent {
|
export class OB11GroupRequestEvent extends OB11BaseRequestEvent {
|
||||||
override post_type = EventType.REQUEST;
|
|
||||||
request_type = 'group';
|
request_type = 'group';
|
||||||
|
|
||||||
override user_id: number;
|
group_id: number;
|
||||||
|
user_id: number;
|
||||||
comment: string;
|
comment: string;
|
||||||
flag: string;
|
flag: string;
|
||||||
sub_type: string;
|
sub_type: string;
|
||||||
|
|
||||||
constructor(core: NapCatCore, groupId: number, userId: number, sub_type: string, comment: string, flag: string) {
|
constructor(core: NapCatCore, groupId: number, userId: number, sub_type: string, comment: string, flag: string) {
|
||||||
super(core, groupId, userId);
|
super(core);
|
||||||
|
this.group_id = groupId;
|
||||||
this.user_id = userId;
|
this.user_id = userId;
|
||||||
this.sub_type = sub_type;
|
this.sub_type = sub_type;
|
||||||
this.comment = comment;
|
this.comment = comment;
|
||||||
|
Reference in New Issue
Block a user