mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-05 07:01:16 +00:00
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.
25 lines
1.0 KiB
TypeScript
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;
|