Files
NapCatQQ/packages/napcat-onebot/action/system/GetVersionInfo.ts
T
手瓜一十雪 974528fe7e Apply formatting and minor style fixes across repo
Normalize code style across multiple packages: whitespace cleanup, consistent commas and trailing commas in arrays/enums/objects, fix table markdown lines in CI comment template, ensure newline at EOF, normalize header/object property quoting and spacing, remove stray blank lines and minor non-functional comment tweaks. These are formatting-only changes and small type/annotation spacing adjustments; no functional behavior changes intended.
2026-03-05 18:45:50 +08:00

35 lines
1.1 KiB
TypeScript

import { OneBotAction } from '@/napcat-onebot/action/OneBotAction';
import { ActionName } from '@/napcat-onebot/action/router';
import { napCatVersion } from 'napcat-common/src/version';
import { Type, Static } from '@sinclair/typebox';
const ReturnSchema = Type.Object({
app_name: Type.String({ description: '应用名称' }),
protocol_version: Type.String({ description: '协议版本' }),
app_version: Type.String({ description: '应用版本' }),
}, { description: '版本信息' });
type ReturnType = Static<typeof ReturnSchema>;
export default class GetVersionInfo extends OneBotAction<void, ReturnType> {
override actionName = ActionName.GetVersionInfo;
override returnSchema = ReturnSchema;
override actionSummary = '获取版本信息';
override actionDescription = '获取版本信息';
override actionTags = ['系统接口'];
override payloadExample = {};
override returnExample = {
app_name: 'NapCat.Onebot',
protocol_version: 'v11',
app_version: '1.0.0',
};
async _handle (): Promise<ReturnType> {
return {
app_name: 'NapCat.Onebot',
protocol_version: 'v11',
app_version: napCatVersion,
};
}
}