mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-21 09:36:35 +00:00
chore: make BaseAction abstract
This commit is contained in:
parent
63237bc112
commit
9feab4bc79
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user