mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-13 00:10:27 +00:00
refactor: add core into all event constructors
This commit is contained in:
@@ -1,11 +1,19 @@
|
||||
import { OB11BaseNoticeEvent } from '../notice/OB11BaseNoticeEvent';
|
||||
import { EventType } from '../OB11BaseEvent';
|
||||
|
||||
import { NapCatCore } from '@/core';
|
||||
|
||||
export class OB11FriendRequestEvent extends OB11BaseNoticeEvent {
|
||||
post_type = EventType.REQUEST;
|
||||
user_id: number = 0;
|
||||
request_type = 'friend' as const;
|
||||
comment: string = '';
|
||||
flag: string = '';
|
||||
request_type = 'friend';
|
||||
|
||||
user_id: number;
|
||||
comment: string;
|
||||
flag: string;
|
||||
|
||||
constructor(core: NapCatCore, user_id: number, comment: string, flag: string) {
|
||||
super(core);
|
||||
this.user_id = user_id;
|
||||
this.comment = comment;
|
||||
this.flag = flag;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,19 @@
|
||||
import { OB11GroupNoticeEvent } from '../notice/OB11GroupNoticeEvent';
|
||||
import { EventType } from '../OB11BaseEvent';
|
||||
|
||||
import { NapCatCore } from '@/core';
|
||||
|
||||
export class OB11GroupRequestEvent extends OB11GroupNoticeEvent {
|
||||
post_type = EventType.REQUEST;
|
||||
request_type = 'group' as const;
|
||||
sub_type: 'add' | 'invite' = 'add';
|
||||
comment: string = '';
|
||||
flag: string = '';
|
||||
request_type = 'group';
|
||||
|
||||
user_id: number;
|
||||
comment: string;
|
||||
flag: string;
|
||||
|
||||
constructor(core: NapCatCore, groupId: number, userId: number, comment: string, flag: string) {
|
||||
super(core, groupId, userId);
|
||||
this.user_id = userId;
|
||||
this.comment = comment;
|
||||
this.flag = flag;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user