迁移类型校验到zod

This commit is contained in:
手瓜一十雪 committed 2025-04-13 20:05:11 +08:00
1 parent 4084e431ec
commit 8a116d2d7b
101 files changed
+951 -945

No files matched your search

+4 -4
View File
@@ -2,13 +2,13 @@ import { OB11Group } from '@/onebot';
import { OB11Construct } from '@/onebot/helper/data';
import { OneBotAction } from '@/onebot/action/OneBotAction';
import { ActionName } from '@/onebot/action/router';
import { Static, Type } from '@sinclair/typebox';
import { z } from 'zod';
const SchemaData = Type.Object({
no_cache: Type.Optional(Type.Union([Type.Boolean(), Type.String()])),
const SchemaData = z.object({
no_cache: z.boolean().default(false),
});
type Payload = Static<typeof SchemaData>;
type Payload = z.infer<typeof SchemaData>;
class GetGroupList extends OneBotAction<Payload, OB11Group[]> {
override actionName = ActionName.GetGroupList;