mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-05 15:11:15 +00:00
Replace Type.Void() payload/return schemas with Type.Object({}) in several OneBot action extensions to represent empty object schemas and avoid void-type validation issues. Updated files: BotExit (payload & return), GetClientkey, GetFriendWithCategory, GetGroupAddRequest, GetRkey, GetRobotUinRange, GetUnidirectionalFriendList.
27 lines
1.0 KiB
TypeScript
27 lines
1.0 KiB
TypeScript
import { ActionName } from '@/napcat-onebot/action/router';
|
|
import { OneBotAction } from '../OneBotAction';
|
|
import { Type, Static } from '@sinclair/typebox';
|
|
|
|
import { ExtendsActionsExamples } from '../example/ExtendsActionsExamples';
|
|
|
|
const ReturnSchema = Type.Object({
|
|
clientkey: Type.Optional(Type.String({ description: '客户端Key' })),
|
|
}, { description: '获取ClientKey结果' });
|
|
|
|
type ReturnType = Static<typeof ReturnSchema>;
|
|
|
|
export class GetClientkey extends OneBotAction<void, ReturnType> {
|
|
override actionName = ActionName.GetClientkey;
|
|
override payloadSchema = Type.Object({});
|
|
override returnSchema = ReturnSchema;
|
|
override actionSummary = '获取ClientKey';
|
|
override actionDescription = '获取当前登录帐号的ClientKey';
|
|
override actionTags = ['扩展接口'];
|
|
override payloadExample = ExtendsActionsExamples.GetClientkey.payload;
|
|
override returnExample = ExtendsActionsExamples.GetClientkey.response;
|
|
|
|
async _handle () {
|
|
return { clientkey: (await this.core.apis.UserApi.forceFetchClientKey()).clientKey };
|
|
}
|
|
}
|