NapCatQQ source snapshot
This commit is contained in:
commit
f954252a34
1111 files changed
+139867
No files matched your search
@@ -0,0 +1,6 @@
|
||||
import { EventType, OneBotEvent } from '@/napcat-onebot/event/OneBotEvent';
|
||||
|
||||
export abstract class OB11BaseMetaEvent extends OneBotEvent {
|
||||
post_type = EventType.META;
|
||||
abstract meta_event_type: string;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import { OB11BaseMetaEvent } from './OB11BaseMetaEvent';
|
||||
import { NapCatCore } from 'napcat-core';
|
||||
|
||||
interface HeartbeatStatus {
|
||||
online: boolean | undefined,
|
||||
good: boolean
|
||||
}
|
||||
|
||||
export class OB11HeartbeatEvent extends OB11BaseMetaEvent {
|
||||
meta_event_type = 'heartbeat';
|
||||
status: HeartbeatStatus;
|
||||
interval: number;
|
||||
|
||||
public constructor (core: NapCatCore, interval: number, isOnline: boolean, isGood: boolean) {
|
||||
super(core);
|
||||
this.interval = interval;
|
||||
this.status = {
|
||||
online: isOnline,
|
||||
good: isGood,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import { OB11BaseMetaEvent } from './OB11BaseMetaEvent';
|
||||
import { NapCatCore } from 'napcat-core';
|
||||
|
||||
export enum LifeCycleSubType {
|
||||
ENABLE = 'enable',
|
||||
DISABLE = 'disable',
|
||||
CONNECT = 'connect',
|
||||
}
|
||||
|
||||
export class OB11LifeCycleEvent extends OB11BaseMetaEvent {
|
||||
meta_event_type = 'lifecycle';
|
||||
sub_type: LifeCycleSubType;
|
||||
|
||||
public constructor (core: NapCatCore, subType: LifeCycleSubType) {
|
||||
super(core);
|
||||
this.sub_type = subType;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export * from './OB11BaseMetaEvent';
|
||||
export * from './OB11HeartbeatEvent';
|
||||
export * from './OB11LifeCycleEvent';
|
||||
Reference in new issue
Block a user