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;
|
||||
|
||||
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;
|
||||
|
||||
@ -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 { NapCatOneBot11Adapter } from '../main';
|
||||
|
||||
class BaseAction<PayloadType, ReturnDataType> {
|
||||
abstract class BaseAction<PayloadType, ReturnDataType> {
|
||||
actionName: ActionName = ActionName.Unknown;
|
||||
CoreContext: NapCatCore;
|
||||
private validate: undefined | ValidateFunction<any> = undefined;
|
||||
@ -64,9 +64,7 @@ class BaseAction<PayloadType, ReturnDataType> {
|
||||
}
|
||||
}
|
||||
|
||||
protected async _handle(payload: PayloadType): Promise<ReturnDataType> {
|
||||
throw `pleas override ${this.actionName} _handle`;
|
||||
}
|
||||
abstract _handle(payload: PayloadType): PromiseLike<ReturnDataType>;
|
||||
}
|
||||
|
||||
export default BaseAction;
|
||||
|
@ -18,7 +18,7 @@ export class OB11NetworkManager {
|
||||
return this.adapters;
|
||||
}
|
||||
|
||||
async PostEvent(event: OB11BaseEvent) {
|
||||
async emitEvent(event: OB11BaseEvent) {
|
||||
// Mlikiowa V2.0.0 Refactor Todo
|
||||
return Promise.all(this.adapters.map(adapter => adapter.onEvent(event)));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user