mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-12 07:50:25 +00:00
迁移类型校验到zod
This commit is contained in:
@@ -2,13 +2,13 @@
|
||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||
import { ActionName } from '@/onebot/action/router';
|
||||
import { NetworkAdapterConfig } from '@/onebot/config/config';
|
||||
import { Static, Type } from '@sinclair/typebox';
|
||||
import { z } from 'zod';
|
||||
|
||||
const SchemaData = Type.Object({
|
||||
count: Type.Union([Type.Number(), Type.String()], { default: 10 }),
|
||||
const SchemaData = z.object({
|
||||
count: z.number().default(10),
|
||||
});
|
||||
|
||||
type Payload = Static<typeof SchemaData>;
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
export default class GetRecentContact extends OneBotAction<Payload, unknown> {
|
||||
override actionName = ActionName.GetRecentContact;
|
||||
|
||||
Reference in New Issue
Block a user