mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-03-02 00:30:25 +00:00
fix
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import { ActionName } from '@/onebot/action/router';
|
||||
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
|
||||
import { z } from 'zod';
|
||||
import { Static, Type } from '@sinclair/typebox';
|
||||
|
||||
const SchemaData = z.object({
|
||||
user_id: z.union([z.number(), z.string()])
|
||||
const SchemaData = Type.Object({
|
||||
user_id: Type.Union([Type.Number(), Type.String()])
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
type Payload = Static<typeof SchemaData>;
|
||||
|
||||
export class FriendPoke extends GetPacketStatusDepends<Payload, void> {
|
||||
override actionName = ActionName.FriendPoke;
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||
import { ActionName } from '@/onebot/action/router';
|
||||
import { z } from 'zod';
|
||||
import { Static, Type } from '@sinclair/typebox';
|
||||
interface Response {
|
||||
cookies: string,
|
||||
bkn: string
|
||||
}
|
||||
|
||||
const SchemaData = z.object({
|
||||
domain: z.string()
|
||||
const SchemaData = Type.Object({
|
||||
domain: Type.String()
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
type Payload = Static<typeof SchemaData>;
|
||||
|
||||
export class GetCookies extends OneBotAction<Payload, Response> {
|
||||
override actionName = ActionName.GetCookies;
|
||||
|
||||
@@ -2,13 +2,13 @@ import { OB11User } from '@/onebot';
|
||||
import { OB11Construct } from '@/onebot/helper/data';
|
||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||
import { ActionName } from '@/onebot/action/router';
|
||||
import { z } from 'zod';
|
||||
import { Static, Type } from '@sinclair/typebox';
|
||||
|
||||
const SchemaData = z.object({
|
||||
no_cache: z.boolean().optional(),
|
||||
const SchemaData = Type.Object({
|
||||
no_cache: Type.Optional(Type.Union([Type.Boolean(), Type.String()])),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
type Payload = Static<typeof SchemaData>;
|
||||
|
||||
export default class GetFriendList extends OneBotAction<Payload, OB11User[]> {
|
||||
override actionName = ActionName.GetFriendList;
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||
import { ActionName } from '@/onebot/action/router';
|
||||
import { NetworkAdapterConfig } from '@/onebot/config/config';
|
||||
import { z } from 'zod';
|
||||
import { Static, Type } from '@sinclair/typebox';
|
||||
|
||||
const SchemaData = z.object({
|
||||
count: z.number().default(10),
|
||||
const SchemaData = Type.Object({
|
||||
count: Type.Union([Type.Number(), Type.String()], { default: 10 }),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
type Payload = Static<typeof SchemaData>;
|
||||
|
||||
export default class GetRecentContact extends OneBotAction<Payload, unknown> {
|
||||
override actionName = ActionName.GetRecentContact;
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||
import { ActionName } from '@/onebot/action/router';
|
||||
import { z } from 'zod';
|
||||
import { Static, Type } from '@sinclair/typebox';
|
||||
|
||||
const SchemaData = z.object({
|
||||
times: z.union([z.number(), z.string()]).default(1),
|
||||
user_id: z.union([z.number(), z.string()])
|
||||
const SchemaData = Type.Object({
|
||||
times: Type.Union([Type.Number(), Type.String()], { default: 1 }),
|
||||
user_id: Type.Union([Type.Number(), Type.String()])
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
type Payload = Static<typeof SchemaData>;
|
||||
|
||||
export default class SendLike extends OneBotAction<Payload, null> {
|
||||
override actionName = ActionName.SendLike;
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||
import { ActionName } from '@/onebot/action/router';
|
||||
import { z } from 'zod';
|
||||
import { Static, Type } from '@sinclair/typebox';
|
||||
|
||||
const SchemaData = z.object({
|
||||
flag: z.union([z.string(), z.number()]),
|
||||
approve: z.union([z.string(), z.boolean()]).default(true),
|
||||
remark: z.union([z.string(), z.null()]).nullable().optional()
|
||||
const SchemaData = Type.Object({
|
||||
flag: Type.Union([Type.String(), Type.Number()]),
|
||||
approve: Type.Optional(Type.Union([Type.String(), Type.Boolean()])),
|
||||
remark: Type.Optional(Type.String())
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
type Payload = Static<typeof SchemaData>;
|
||||
|
||||
export default class SetFriendAddRequest extends OneBotAction<Payload, null> {
|
||||
override actionName = ActionName.SetFriendAddRequest;
|
||||
|
||||
Reference in New Issue
Block a user