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,4 +1,4 @@
import { selfInfo } from '@/core/data';
import { InstanceContext, NapCatCore } from '@/core';
export enum EventType {
META = 'meta_event',
@@ -8,9 +8,12 @@ export enum EventType {
MESSAGE_SENT = 'message_sent',
}
export abstract class OB11BaseEvent {
time = Math.floor(Date.now() / 1000);
self_id = parseInt(selfInfo.uin);
post_type: EventType = EventType.META;
self_id: number;
abstract post_type: EventType;
constructor(core: NapCatCore) {
this.self_id = parseInt(core.selfInfo.uin);
}
}