refactor: add core into all event constructors

This commit is contained in:
Wesley F. Young
2024-08-10 22:11:57 +08:00
parent 30e89c643e
commit 2d46017d06
20 changed files with 97 additions and 57 deletions

View File

@@ -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;
}
}

View File

@@ -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;
}
}