mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-04 22:51:13 +00:00
Replaced imports of ActionExamples with ExtendsActionsExamples in all extends actions. Updated action summary, description, tags, and example references for consistency and clarity across actions. This improves maintainability and aligns with the new examples structure.
33 lines
1.3 KiB
TypeScript
33 lines
1.3 KiB
TypeScript
import { OneBotAction } from '@/napcat-onebot/action/OneBotAction';
|
||
import { ActionName, BaseCheckResult } from '@/napcat-onebot/action/router';
|
||
import { Type } from '@sinclair/typebox';
|
||
import { PacketActionsExamples } from './examples';
|
||
|
||
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 = PacketActionsExamples.GetPacketStatus.payload;
|
||
override returnExample = PacketActionsExamples.GetPacketStatus.response;
|
||
|
||
async _handle () {
|
||
|
||
}
|
||
}
|