mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-03-01 08:10:25 +00:00
@@ -3,8 +3,8 @@ import { ActionName } from '@/onebot/action/router';
|
||||
import { z } from 'zod';
|
||||
|
||||
const SchemaData = z.object({
|
||||
group_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||
folder_name: z.coerce.string(),
|
||||
group_id: z.union([z.number(), z.string()]),
|
||||
folder_name: z.string(),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -6,8 +6,8 @@ import { z } from 'zod';
|
||||
import { NTQQGroupApi } from '@/core/apis';
|
||||
|
||||
const SchemaData = z.object({
|
||||
group_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||
file_id: z.coerce.string(),
|
||||
group_id: z.union([z.number(), z.string()]),
|
||||
file_id: z.string(),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -4,9 +4,9 @@ import { z } from 'zod';
|
||||
import { NTQQGroupApi } from '@/core/apis';
|
||||
|
||||
const SchemaData = z.object({
|
||||
group_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||
folder_id: z.coerce.string().optional(),
|
||||
folder: z.coerce.string().optional(),
|
||||
group_id: z.union([z.number(), z.string()]),
|
||||
folder_id: z.string().optional(),
|
||||
folder: z.string().optional(),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -11,10 +11,10 @@ interface FileResponse {
|
||||
}
|
||||
|
||||
const SchemaData = z.object({
|
||||
url: z.coerce.string().optional(),
|
||||
base64: z.coerce.string().optional(),
|
||||
name: z.coerce.string().optional(),
|
||||
headers: z.union([z.coerce.string(), z.array(z.coerce.string())]).optional(),
|
||||
url: z.string().optional(),
|
||||
base64: z.string().optional(),
|
||||
name: z.string().optional(),
|
||||
headers: z.union([z.string(), z.array(z.string())]).optional(),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -7,8 +7,8 @@ import { z } from 'zod';
|
||||
import { isNumeric } from '@/common/helper';
|
||||
|
||||
const SchemaData = z.object({
|
||||
message_id: z.coerce.string().optional(),
|
||||
id: z.coerce.string().optional(),
|
||||
message_id: z.string().optional(),
|
||||
id: z.string().optional(),
|
||||
});
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
|
||||
@@ -10,10 +10,10 @@ interface Response {
|
||||
messages: OB11Message[];
|
||||
}
|
||||
const SchemaData = z.object({
|
||||
user_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||
message_seq: z.union([z.coerce.number(), z.coerce.string()]).optional(),
|
||||
count: z.union([z.coerce.number(), z.coerce.string()]).default(20),
|
||||
reverseOrder: z.coerce.boolean().default(false)
|
||||
user_id: z.union([z.number(), z.string()]),
|
||||
message_seq: z.union([z.number(), z.string()]).optional(),
|
||||
count: z.union([z.number(), z.string()]).default(20),
|
||||
reverseOrder: z.boolean().default(false)
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import { ActionName } from '@/onebot/action/router';
|
||||
import { z } from 'zod';
|
||||
|
||||
const SchemaData = z.object({
|
||||
group_id: z.union([z.coerce.number(), z.coerce.string()])
|
||||
group_id: z.union([z.number(), z.string()])
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -3,7 +3,7 @@ import { ActionName } from '@/onebot/action/router';
|
||||
import { z } from 'zod';
|
||||
|
||||
const SchemaData = z.object({
|
||||
group_id: z.union([z.coerce.number(), z.coerce.string()])
|
||||
group_id: z.union([z.number(), z.string()])
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -5,10 +5,10 @@ import { OB11Construct } from '@/onebot/helper/data';
|
||||
import { z } from 'zod';
|
||||
|
||||
const SchemaData = z.object({
|
||||
group_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||
folder_id: z.coerce.string().optional(),
|
||||
folder: z.coerce.string().optional(),
|
||||
file_count: z.union([z.coerce.number(), z.coerce.string()]).default(50),
|
||||
group_id: z.union([z.number(), z.string()]),
|
||||
folder_id: z.string().optional(),
|
||||
folder: z.string().optional(),
|
||||
file_count: z.union([z.number(), z.string()]).default(50),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -4,7 +4,7 @@ import { ActionName } from '@/onebot/action/router';
|
||||
import { z } from 'zod';
|
||||
|
||||
const SchemaData = z.object({
|
||||
group_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||
group_id: z.union([z.number(), z.string()]),
|
||||
type: z.nativeEnum(WebHonorType).optional()
|
||||
});
|
||||
|
||||
|
||||
@@ -11,10 +11,10 @@ interface Response {
|
||||
}
|
||||
|
||||
const SchemaData = z.object({
|
||||
group_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||
message_seq: z.union([z.coerce.number(), z.coerce.string()]).optional(),
|
||||
count: z.union([z.coerce.number(), z.coerce.string()]).default(20),
|
||||
reverseOrder: z.coerce.boolean().default(false)
|
||||
group_id: z.union([z.number(), z.string()]),
|
||||
message_seq: z.union([z.number(), z.string()]).optional(),
|
||||
count: z.union([z.number(), z.string()]).default(20),
|
||||
reverseOrder: z.boolean().default(false)
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@ import { OB11Construct } from '@/onebot/helper/data';
|
||||
import { z } from 'zod';
|
||||
|
||||
const SchemaData = z.object({
|
||||
group_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||
file_count: z.union([z.coerce.number(), z.coerce.string()]).default(50),
|
||||
group_id: z.union([z.number(), z.string()]),
|
||||
file_count: z.union([z.number(), z.string()]).default(50),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -6,8 +6,8 @@ import { calcQQLevel } from '@/common/helper';
|
||||
import { z } from 'zod';
|
||||
|
||||
const SchemaData = z.object({
|
||||
user_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||
no_cache: z.coerce.boolean().default(false),
|
||||
user_id: z.union([z.number(), z.string()]),
|
||||
no_cache: z.boolean().default(false),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -3,7 +3,7 @@ import { ActionName } from '@/onebot/action/router';
|
||||
import { z } from 'zod';
|
||||
|
||||
const SchemaData = z.object({
|
||||
url: z.coerce.string(),
|
||||
url: z.string(),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -3,10 +3,10 @@ import { ActionName } from '@/onebot/action/router';
|
||||
import { z } from 'zod';
|
||||
|
||||
const SchemaData = z.object({
|
||||
friend_id: z.union([z.coerce.string(), z.coerce.number()]).optional(),
|
||||
user_id: z.union([z.coerce.string(), z.coerce.number()]).optional(),
|
||||
temp_block: z.coerce.boolean().optional(),
|
||||
temp_both_del: z.coerce.boolean().optional(),
|
||||
friend_id: z.union([z.string(), z.number()]).optional(),
|
||||
user_id: z.union([z.string(), z.number()]).optional(),
|
||||
temp_block: z.boolean().optional(),
|
||||
temp_both_del: z.boolean().optional(),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -3,7 +3,7 @@ import { ActionName } from '@/onebot/action/router';
|
||||
import { z } from 'zod';
|
||||
|
||||
const SchemaData = z.object({
|
||||
model: z.coerce.string(),
|
||||
model: z.string(),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -5,14 +5,14 @@ import { unlink } from 'node:fs/promises';
|
||||
import { z } from 'zod';
|
||||
|
||||
const SchemaData = z.object({
|
||||
group_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||
content: z.coerce.string(),
|
||||
image: z.coerce.string().optional(),
|
||||
pinned: z.union([z.coerce.number(), z.coerce.string()]).default(0),
|
||||
type: z.union([z.coerce.number(), z.coerce.string()]).default(1),
|
||||
confirm_required: z.union([z.coerce.number(), z.coerce.string()]).default(1),
|
||||
is_show_edit_card: z.union([z.coerce.number(), z.coerce.string()]).default(0),
|
||||
tip_window_type: z.union([z.coerce.number(), z.coerce.string()]).default(0),
|
||||
group_id: z.union([z.number(), z.string()]),
|
||||
content: z.string(),
|
||||
image: z.string().optional(),
|
||||
pinned: z.union([z.number(), z.string()]).default(0),
|
||||
type: z.union([z.number(), z.string()]).default(1),
|
||||
confirm_required: z.union([z.number(), z.string()]).default(1),
|
||||
is_show_edit_card: z.union([z.number(), z.string()]).default(0),
|
||||
tip_window_type: z.union([z.number(), z.string()]).default(0),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -5,8 +5,8 @@ import { z } from 'zod';
|
||||
import fs from 'node:fs/promises';
|
||||
import { GeneralCallResult } from '@/core';
|
||||
const SchemaData = z.object({
|
||||
file: z.coerce.string(),
|
||||
group_id: z.union([z.coerce.number(), z.coerce.string()])
|
||||
file: z.string(),
|
||||
group_id: z.union([z.number(), z.string()])
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -4,9 +4,9 @@ import { ActionName } from '@/onebot/action/router';
|
||||
import { z } from 'zod';
|
||||
|
||||
const SchemaData = z.object({
|
||||
nickname: z.coerce.string(),
|
||||
personal_note: z.coerce.string().optional(),
|
||||
sex: z.union([z.coerce.number(), z.coerce.string()]).optional(), // 传Sex值?建议传0
|
||||
nickname: z.string(),
|
||||
personal_note: z.string().optional(),
|
||||
sex: z.union([z.number(), z.string()]).optional(), // 传Sex值?建议传0
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -7,11 +7,11 @@ import { SendMessageContext } from '@/onebot/api';
|
||||
import { z } from 'zod';
|
||||
|
||||
const SchemaData = z.object({
|
||||
group_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||
file: z.coerce.string(),
|
||||
name: z.coerce.string(),
|
||||
folder: z.coerce.string().optional(),
|
||||
folder_id: z.coerce.string().optional(),//临时扩展
|
||||
group_id: z.union([z.number(), z.string()]),
|
||||
file: z.string(),
|
||||
name: z.string(),
|
||||
folder: z.string().optional(),
|
||||
folder_id: z.string().optional(),//临时扩展
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -8,9 +8,9 @@ import { ContextMode, createContext } from '@/onebot/action/msg/SendMsg';
|
||||
import { z } from 'zod';
|
||||
|
||||
const SchemaData = z.object({
|
||||
user_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||
file: z.coerce.string(),
|
||||
name: z.coerce.string(),
|
||||
user_id: z.union([z.number(), z.string()]),
|
||||
file: z.string(),
|
||||
name: z.string(),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
Reference in New Issue
Block a user