NapCatQQ/packages/napcat-onebot/action/packet/GetPacketStatus.ts
手瓜一十雪 60a9114495 Add action metadata to OneBot action classes
Added or updated actionSummary, actionTags, payloadExample, and returnExample properties for all OneBot action classes in the napcat-onebot package. This improves API documentation and discoverability by providing concise summaries, categorization tags, and usage examples for each action.
2026-01-25 19:19:03 +08:00

32 lines
1.2 KiB
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 { OneBotAction } from '@/napcat-onebot/action/OneBotAction';
import { ActionName, BaseCheckResult } from '@/napcat-onebot/action/router';
import { Type } from '@sinclair/typebox';
export abstract class GetPacketStatusDepends<PT, RT> extends OneBotAction<PT, RT> {
protected override async check (payload: PT): Promise<BaseCheckResult> {
if (!this.core.apis.PacketApi.packetStatus) {
return {
valid: false,
message: 'packetBackend不可用请参照文档 https://napneko.github.io/config/advanced 和启动日志检查packetBackend状态或进行配置' +
'错误堆栈信息:' + this.core.apis.PacketApi.clientLogStack,
};
}
return await super.check(payload);
}
}
export class GetPacketStatus extends GetPacketStatusDepends<void, void> {
override actionName = ActionName.GetPacketStatus;
override payloadSchema = Type.Object({});
override returnSchema = Type.Null();
override actionSummary = '获取Packet状态';
override actionDescription = '获取底层Packet服务的运行状态';
override actionTags = ['系统接口'];
override payloadExample = {};
override returnExample = null;
async _handle () {
}
}