mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-12 07:50:25 +00:00
@@ -3,11 +3,11 @@ import { OneBotAction } from '../OneBotAction';
|
||||
import { z } from 'zod';
|
||||
|
||||
const SchemaData = z.object({
|
||||
group_id: z.coerce.string(),
|
||||
bot_appid: z.coerce.string(),
|
||||
button_id: z.coerce.string().default(''),
|
||||
callback_data: z.coerce.string().default(''),
|
||||
msg_seq: z.coerce.string().default('10086'),
|
||||
group_id: z.string(),
|
||||
bot_appid: z.string(),
|
||||
button_id: z.string().default(''),
|
||||
callback_data: z.string().default(''),
|
||||
msg_seq: z.string().default('10086'),
|
||||
});
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@ import { ActionName } from '@/onebot/action/router';
|
||||
import { z } from 'zod';
|
||||
|
||||
const SchemaData = z.object({
|
||||
rawData: z.coerce.string(),
|
||||
brief: z.coerce.string(),
|
||||
rawData: z.string(),
|
||||
brief: z.string(),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -3,7 +3,7 @@ import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||
import { ActionName } from '@/onebot/action/router';
|
||||
|
||||
const SchemaData = z.object({
|
||||
count: z.coerce.number().default(48),
|
||||
count: z.number().default(48),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -5,10 +5,10 @@ import { MessageUnique } from '@/common/message-unique';
|
||||
import { type NTQQMsgApi } from '@/core/apis';
|
||||
|
||||
const SchemaData = z.object({
|
||||
message_id: z.coerce.string(),
|
||||
emojiId: z.coerce.string(),
|
||||
emojiType: z.coerce.string(),
|
||||
count: z.coerce.number().default(20),
|
||||
message_id: z.string(),
|
||||
emojiId: z.string(),
|
||||
emojiType: z.string(),
|
||||
count: z.number().default(20),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -4,8 +4,8 @@ import { AIVoiceChatType } from '@/core/packet/entities/aiChat';
|
||||
import { z } from 'zod';
|
||||
|
||||
const SchemaData = z.object({
|
||||
group_id: z.coerce.string(),
|
||||
chat_type: z.coerce.number().default(1),
|
||||
group_id: z.string(),
|
||||
chat_type: z.number().default(1),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -4,8 +4,8 @@ import { ActionName } from '@/onebot/action/router';
|
||||
import { z } from 'zod';
|
||||
|
||||
const SchemaData = z.object({
|
||||
category: z.coerce.number(),
|
||||
count: z.coerce.number().default(1),
|
||||
category: z.number(),
|
||||
count: z.number().default(1),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -2,7 +2,7 @@ import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||
import { ActionName } from '@/onebot/action/router';
|
||||
import { z } from 'zod';
|
||||
const SchemaData = z.object({
|
||||
group_id: z.coerce.string(),
|
||||
group_id: z.string(),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -7,30 +7,30 @@ import { z } from 'zod';
|
||||
const SchemaData = z.union([
|
||||
z.object({
|
||||
type: z.union([z.literal('bili'), z.literal('weibo')]),
|
||||
title: z.coerce.string(),
|
||||
desc: z.coerce.string(),
|
||||
picUrl: z.coerce.string(),
|
||||
jumpUrl: z.coerce.string(),
|
||||
webUrl: z.coerce.string().optional(),
|
||||
rawArkData: z.coerce.string().optional()
|
||||
title: z.string(),
|
||||
desc: z.string(),
|
||||
picUrl: z.string(),
|
||||
jumpUrl: z.string(),
|
||||
webUrl: z.string().optional(),
|
||||
rawArkData: z.string().optional()
|
||||
}),
|
||||
z.object({
|
||||
title: z.coerce.string(),
|
||||
desc: z.coerce.string(),
|
||||
picUrl: z.coerce.string(),
|
||||
jumpUrl: z.coerce.string(),
|
||||
iconUrl: z.coerce.string(),
|
||||
webUrl: z.coerce.string().optional(),
|
||||
appId: z.coerce.string(),
|
||||
scene: z.union([z.coerce.number(), z.coerce.string()]),
|
||||
templateType: z.union([z.coerce.number(), z.coerce.string()]),
|
||||
businessType: z.union([z.coerce.number(), z.coerce.string()]),
|
||||
verType: z.union([z.coerce.number(), z.coerce.string()]),
|
||||
shareType: z.union([z.coerce.number(), z.coerce.string()]),
|
||||
versionId: z.coerce.string(),
|
||||
sdkId: z.coerce.string(),
|
||||
withShareTicket: z.union([z.coerce.number(), z.coerce.string()]),
|
||||
rawArkData: z.coerce.string().optional()
|
||||
title: z.string(),
|
||||
desc: z.string(),
|
||||
picUrl: z.string(),
|
||||
jumpUrl: z.string(),
|
||||
iconUrl: z.string(),
|
||||
webUrl: z.string().optional(),
|
||||
appId: z.string(),
|
||||
scene: z.union([z.number(), z.string()]),
|
||||
templateType: z.union([z.number(), z.string()]),
|
||||
businessType: z.union([z.number(), z.string()]),
|
||||
verType: z.union([z.number(), z.string()]),
|
||||
shareType: z.union([z.number(), z.string()]),
|
||||
versionId: z.string(),
|
||||
sdkId: z.string(),
|
||||
withShareTicket: z.union([z.number(), z.string()]),
|
||||
rawArkData: z.string().optional()
|
||||
})
|
||||
]);
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -4,9 +4,9 @@ import { ActionName } from '@/onebot/action/router';
|
||||
import { z } from 'zod';
|
||||
|
||||
const SchemaData = z.object({
|
||||
user_id: z.coerce.string().optional(),
|
||||
start: z.coerce.number().default(0),
|
||||
count: z.coerce.number().default(10),
|
||||
user_id: z.string().optional(),
|
||||
start: z.number().default(0),
|
||||
count: z.number().default(10),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -3,7 +3,7 @@ import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
|
||||
import { z } from 'zod';
|
||||
|
||||
const SchemaData = z.object({
|
||||
user_id: z.coerce.number(),
|
||||
user_id: z.number(),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -4,10 +4,10 @@ import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
|
||||
import { z } from 'zod';
|
||||
|
||||
const SchemaData = z.object({
|
||||
group_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||
file_id: z.coerce.string(),
|
||||
current_parent_directory: z.coerce.string(),
|
||||
target_parent_directory: z.coerce.string(),
|
||||
group_id: z.union([z.number(), z.string()]),
|
||||
file_id: z.string(),
|
||||
current_parent_directory: z.string(),
|
||||
target_parent_directory: z.string(),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -6,7 +6,7 @@ import { z } from 'zod';
|
||||
import { GeneralCallResultStatus } from '@/core';
|
||||
|
||||
const SchemaData = z.object({
|
||||
image: z.coerce.string(),
|
||||
image: z.string(),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -4,10 +4,10 @@ import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
|
||||
import { z } from 'zod';
|
||||
|
||||
const SchemaData = z.object({
|
||||
group_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||
file_id: z.coerce.string(),
|
||||
current_parent_directory: z.coerce.string(),
|
||||
new_name: z.coerce.string(),
|
||||
group_id: z.union([z.number(), z.string()]),
|
||||
file_id: z.string(),
|
||||
current_parent_directory: z.string(),
|
||||
new_name: 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({
|
||||
cmd: z.coerce.string(),
|
||||
data: z.coerce.string(),
|
||||
rsp: z.coerce.boolean().default(true),
|
||||
cmd: z.string(),
|
||||
data: z.string(),
|
||||
rsp: z.boolean().default(true),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -3,9 +3,9 @@ import { ActionName } from '@/onebot/action/router';
|
||||
import { z } from 'zod';
|
||||
|
||||
const SchemaData = z.object({
|
||||
face_id: z.union([z.coerce.number(), z.coerce.string()]),// 参考 face_config.json 的 QSid
|
||||
face_type: z.union([z.coerce.number(), z.coerce.string()]).default('1'),
|
||||
wording: z.coerce.string().default(' '),
|
||||
face_id: z.union([z.number(), z.string()]),// 参考 face_config.json 的 QSid
|
||||
face_type: z.union([z.number(), z.string()]).default('1'),
|
||||
wording: z.string().default(' '),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -3,8 +3,8 @@ import { ActionName } from '@/onebot/action/router';
|
||||
import { z } from 'zod';
|
||||
|
||||
const SchemaData = z.object({
|
||||
group_id: z.coerce.string(),
|
||||
remark: z.coerce.string(),
|
||||
group_id: z.string(),
|
||||
remark: 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>;
|
||||
|
||||
@@ -4,8 +4,8 @@ import { ChatType } from '@/core';
|
||||
import { z } from 'zod';
|
||||
|
||||
const SchemaData = z.object({
|
||||
user_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||
event_type: z.coerce.number(),
|
||||
user_id: z.union([z.number(), z.string()]),
|
||||
event_type: z.number(),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -3,7 +3,7 @@ import { ActionName } from '@/onebot/action/router';
|
||||
import { z } from 'zod';
|
||||
|
||||
const SchemaData = z.object({
|
||||
longNick: z.coerce.string(),
|
||||
longNick: z.string(),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -3,9 +3,9 @@ import { ActionName } from '@/onebot/action/router';
|
||||
import { z } from 'zod';
|
||||
|
||||
const SchemaData = z.object({
|
||||
status: z.union([z.coerce.number(), z.coerce.string()]),
|
||||
ext_status: z.union([z.coerce.number(), z.coerce.string()]),
|
||||
battery_status: z.union([z.coerce.number(), z.coerce.string()]),
|
||||
status: z.union([z.number(), z.string()]),
|
||||
ext_status: z.union([z.number(), z.string()]),
|
||||
battery_status: z.union([z.number(), z.string()]),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -5,7 +5,7 @@ import { checkFileExist, uriToLocalFile } from '@/common/file';
|
||||
import { z } from 'zod';
|
||||
|
||||
const SchemaData = z.object({
|
||||
file: z.coerce.string(),
|
||||
file: z.string(),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -3,9 +3,9 @@ import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
|
||||
import { z } from 'zod';
|
||||
|
||||
const SchemaData = z.object({
|
||||
group_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||
user_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||
special_title: z.coerce.string().default(''),
|
||||
group_id: z.union([z.number(), z.string()]),
|
||||
user_id: z.union([z.number(), z.string()]),
|
||||
special_title: z.string().default(''),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -4,9 +4,9 @@ import { ActionName } from '@/onebot/action/router';
|
||||
import { z } from 'zod';
|
||||
|
||||
const SchemaData = z.object({
|
||||
user_id: z.union([z.coerce.number(), z.coerce.string()]).optional(),
|
||||
group_id: z.union([z.coerce.number(), z.coerce.string()]).optional(),
|
||||
phoneNumber: z.coerce.string().default(''),
|
||||
user_id: z.union([z.number(), z.string()]).optional(),
|
||||
group_id: z.union([z.number(), z.string()]).optional(),
|
||||
phoneNumber: z.string().default(''),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
@@ -29,7 +29,7 @@ export class SharePeer extends OneBotAction<Payload, GeneralCallResult & {
|
||||
}
|
||||
|
||||
const SchemaDataGroupEx = z.object({
|
||||
group_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||
group_id: z.union([z.number(), z.string()]),
|
||||
});
|
||||
|
||||
type PayloadGroupEx = z.infer<typeof SchemaDataGroupEx>;
|
||||
|
||||
@@ -4,8 +4,8 @@ import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
|
||||
import { z } from 'zod';
|
||||
|
||||
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>;
|
||||
|
||||
@@ -3,7 +3,7 @@ import { ActionName } from '@/onebot/action/router';
|
||||
import { z } from 'zod';
|
||||
|
||||
const SchemaData = z.object({
|
||||
words: z.array(z.coerce.string()),
|
||||
words: z.array(z.string()),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
Reference in New Issue
Block a user