mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-16 13:01:14 +00:00
Merge branch 'v2' of https://github.com/NapNeko/NapCatQQ into v2
This commit is contained in:
commit
ef7d2f4a82
@ -105,7 +105,16 @@ export interface IKernelMsgListener {
|
|||||||
|
|
||||||
onImportOldDbProgressUpdate(importOldDbMsgNotifyInfo: unknown): void;
|
onImportOldDbProgressUpdate(importOldDbMsgNotifyInfo: unknown): void;
|
||||||
|
|
||||||
onInputStatusPush(inputStatusInfo: unknown): void;
|
onInputStatusPush(inputStatusInfo: {
|
||||||
|
chatType: number;
|
||||||
|
eventType: number;
|
||||||
|
fromUin: string;
|
||||||
|
interval: string;
|
||||||
|
showTime: string;
|
||||||
|
statusText: string;
|
||||||
|
timestamp: string;
|
||||||
|
toUin: string;
|
||||||
|
}): void;
|
||||||
|
|
||||||
onKickedOffLine(kickedInfo: unknown): void;
|
onKickedOffLine(kickedInfo: unknown): void;
|
||||||
|
|
||||||
@ -341,7 +350,16 @@ export class MsgListener implements IKernelMsgListener {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onInputStatusPush(inputStatusInfo: unknown) {
|
onInputStatusPush(inputStatusInfo: {
|
||||||
|
chatType: number;
|
||||||
|
eventType: number;
|
||||||
|
fromUin: string;
|
||||||
|
interval: string;
|
||||||
|
showTime: string;
|
||||||
|
statusText: string;
|
||||||
|
timestamp: string;
|
||||||
|
toUin: string;
|
||||||
|
}) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ import Ajv, { ErrorObject, ValidateFunction } from 'ajv';
|
|||||||
import { NapCatCore } from '@/core';
|
import { NapCatCore } from '@/core';
|
||||||
import { NapCatOneBot11Adapter } from '../main';
|
import { NapCatOneBot11Adapter } from '../main';
|
||||||
|
|
||||||
class BaseAction<PayloadType, ReturnDataType> {
|
abstract class BaseAction<PayloadType, ReturnDataType> {
|
||||||
actionName: ActionName = ActionName.Unknown;
|
actionName: ActionName = ActionName.Unknown;
|
||||||
CoreContext: NapCatCore;
|
CoreContext: NapCatCore;
|
||||||
private validate: undefined | ValidateFunction<any> = undefined;
|
private validate: undefined | ValidateFunction<any> = undefined;
|
||||||
@ -64,9 +64,7 @@ class BaseAction<PayloadType, ReturnDataType> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async _handle(payload: PayloadType): Promise<ReturnDataType> {
|
abstract _handle(payload: PayloadType): PromiseLike<ReturnDataType>;
|
||||||
throw `pleas override ${this.actionName} _handle`;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default BaseAction;
|
export default BaseAction;
|
||||||
|
@ -18,7 +18,7 @@ export class OB11NetworkManager {
|
|||||||
return this.adapters;
|
return this.adapters;
|
||||||
}
|
}
|
||||||
|
|
||||||
async PostEvent(event: OB11BaseEvent) {
|
async emitEvent(event: OB11BaseEvent) {
|
||||||
// Mlikiowa V2.0.0 Refactor Todo
|
// Mlikiowa V2.0.0 Refactor Todo
|
||||||
return Promise.all(this.adapters.map(adapter => adapter.onEvent(event)));
|
return Promise.all(this.adapters.map(adapter => adapter.onEvent(event)));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user