迁移类型校验到zod

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

View File

@@ -1,12 +1,12 @@
import { Type, Static } from '@sinclair/typebox';
import { z } from 'zod';
import { OneBotAction } from '@/onebot/action/OneBotAction';
import { ActionName } from '@/onebot/action/router';
const SchemaData = Type.Object({
count: Type.Union([Type.Number(), Type.String()], { default: 48 }),
const SchemaData = z.object({
count: z.number().default(48),
});
type Payload = Static<typeof SchemaData>;
type Payload = z.infer<typeof SchemaData>;
export class FetchCustomFace extends OneBotAction<Payload, string[]> {
override actionName = ActionName.FetchCustomFace;