Files
NapCatQQ/src/onebot/action/packet/GetPacketStatus.ts

24 lines
760 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import BaseAction from '../BaseAction';
import { ActionName, BaseCheckResult } from '../types';
export abstract class GetPacketStatusDepends<PT, RT> extends BaseAction<PT, RT> {
actionName = ActionName.GetPacketStatus;
protected async check(payload: PT): Promise<BaseCheckResult>{
if (!this.core.apis.PacketApi.available) {
return {
valid: false,
message: "packetServer不可用请参照文档 https://napneko.github.io/config/advanced 检查packetServer状态或进行配置",
};
}
return await super.check(payload);
}
}
export class GetPacketStatus extends GetPacketStatusDepends<any, null> {
async _handle(payload: any) {
return null;
}
}