Files
NapCatQQ/packages/napcat-onebot/action/system/GetVersionInfo.ts
T
时瑾 e6f6468377
Release NapCat / validate-version (push) Canceled after 0s
Release NapCat / Build-Framework (push) Canceled after 0s
Release NapCat / Build-Shell (push) Canceled after 0s
Release NapCat / Download-QNX64 (push) Canceled after 0s
Release NapCat / release-napcat (push) Canceled after 0s
Revert "fix: 对齐 OneBot schema 与合并转发消息处理行为 (#1694)" (#1701)
This reverts commit deae7fd467.
2026-03-13 15:26:53 +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,
};
}
}