NapCatQQ/packages/napcat-onebot/action/system/GetLoginInfo.ts
手瓜一十雪 1fa0980709 Refactor action examples structure and imports
Moved action example files into a new 'example' directory and updated all imports accordingly. Removed the monolithic 'examples.ts' and redefined ActionExamples in OneBotAction.ts to only include common error codes. This improves code organization and maintainability.
2026-01-27 16:45:44 +08:00

25 lines
1.0 KiB
TypeScript

import { OB11User } from '@/napcat-onebot/index';
import { OB11Construct } from '@/napcat-onebot/helper/data';
import { OneBotAction } from '@/napcat-onebot/action/OneBotAction';
import { ActionName } from '@/napcat-onebot/action/router';
import { OB11UserSchema } from '../schemas';
import { Type } from '@sinclair/typebox';
import { SystemActionsExamples } from '@/napcat-onebot/action/example/SystemActionsExamples';
class GetLoginInfo extends OneBotAction<void, OB11User> {
override actionName = ActionName.GetLoginInfo;
override payloadSchema = Type.Object({});
override returnSchema = OB11UserSchema;
override actionSummary = '获取登录号信息';
override actionDescription = '获取当前登录帐号的信息';
override actionTags = ['系统接口'];
override payloadExample = SystemActionsExamples.GetLoginInfo.payload;
override returnExample = SystemActionsExamples.GetLoginInfo.response;
async _handle () {
return OB11Construct.selfInfo(this.core.selfInfo);
}
}
export default GetLoginInfo;