Replace Type.Void() with Type.Object({})

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.
This commit is contained in:
手瓜一十雪 2026-02-02 13:17:06 +08:00
parent 870db6c4ce
commit 41bab4fabb
7 changed files with 8 additions and 8 deletions

View File

@ -4,8 +4,8 @@ import { Type } from '@sinclair/typebox';
export class BotExit extends OneBotAction<void, void> {
override actionName = ActionName.Exit;
override payloadSchema = Type.Void();
override returnSchema = Type.Void();
override payloadSchema = Type.Object({});
override returnSchema = Type.Object({});
override actionSummary = '退出登录';
override actionTags = ['系统扩展'];
override payloadExample = {};

View File

@ -12,7 +12,7 @@ type ReturnType = Static<typeof ReturnSchema>;
export class GetClientkey extends OneBotAction<void, ReturnType> {
override actionName = ActionName.GetClientkey;
override payloadSchema = Type.Void();
override payloadSchema = Type.Object({});
override returnSchema = ReturnSchema;
override actionSummary = '获取ClientKey';
override actionDescription = '获取当前登录帐号的ClientKey';

View File

@ -18,7 +18,7 @@ type ReturnType = Static<typeof ReturnSchema>;
export class GetFriendWithCategory extends OneBotAction<void, ReturnType> {
override actionName = ActionName.GetFriendsWithCategory;
override payloadSchema = Type.Void();
override payloadSchema = Type.Object({});
override returnSchema = ReturnSchema;
override actionSummary = '获取带分组的好友列表';
override actionTags = ['用户扩展'];

View File

@ -22,7 +22,7 @@ type ReturnType = Static<typeof ReturnSchema>;
export default class GetGroupAddRequest extends OneBotAction<void, ReturnType> {
override actionName = ActionName.GetGroupIgnoreAddRequest;
override payloadSchema = Type.Void();
override payloadSchema = Type.Object({});
override returnSchema = ReturnSchema;
override actionSummary = '获取群被忽略的加群请求';
override actionTags = ['群组接口'];

View File

@ -8,7 +8,7 @@ type ReturnType = Static<typeof ReturnSchema>;
export class GetRkey extends GetPacketStatusDepends<void, ReturnType> {
override actionName = ActionName.GetRkey;
override payloadSchema = Type.Void();
override payloadSchema = Type.Object({});
override returnSchema = ReturnSchema;
override actionSummary = '获取 RKey';
override actionTags = ['系统扩展'];

View File

@ -14,7 +14,7 @@ export class GetRobotUinRange extends OneBotAction<void, ReturnType> {
override returnExample = [
{ minUin: '12345678', maxUin: '87654321' }
];
override payloadSchema = Type.Void();
override payloadSchema = Type.Object({});
override returnSchema = ReturnSchema;
async _handle () {

View File

@ -19,7 +19,7 @@ type ReturnType = Static<typeof ReturnSchema>;
export class GetUnidirectionalFriendList extends OneBotAction<void, ReturnType> {
override actionName = ActionName.GetUnidirectionalFriendList;
override payloadSchema = Type.Void();
override payloadSchema = Type.Object({});
override returnSchema = ReturnSchema;
override actionSummary = '获取单向好友列表';
override actionTags = ['用户扩展'];