fix: checker

This commit is contained in:
手瓜一十雪
2025-04-15 12:34:33 +08:00
parent 06538b9122
commit 941978b578
56 changed files with 93 additions and 93 deletions

View File

@@ -4,7 +4,7 @@ import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
import { z } from 'zod'; import { z } from 'zod';
const SchemaData = z.object({ const SchemaData = z.object({
group_id: z.union([z.coerce.number(), z.coerce.string()]), group_id: z.coerce.string(),
file_id: z.coerce.string(), file_id: z.coerce.string(),
current_parent_directory: z.coerce.string(), current_parent_directory: z.coerce.string(),
target_parent_directory: z.coerce.string(), target_parent_directory: z.coerce.string(),

View File

@@ -4,7 +4,7 @@ import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
import { z } from 'zod'; import { z } from 'zod';
const SchemaData = z.object({ const SchemaData = z.object({
group_id: z.union([z.coerce.number(), z.coerce.string()]), group_id: z.coerce.string(),
file_id: z.coerce.string(), file_id: z.coerce.string(),
current_parent_directory: z.coerce.string(), current_parent_directory: z.coerce.string(),
new_name: z.coerce.string(), new_name: z.coerce.string(),

View File

@@ -3,8 +3,8 @@ import { ActionName } from '@/onebot/action/router';
import { z } from 'zod'; import { z } from 'zod';
const SchemaData = z.object({ const SchemaData = z.object({
face_id: z.union([z.coerce.number(), z.coerce.string()]),// 参考 face_config.json 的 QSid face_id: z.coerce.string(),// 参考 face_config.json 的 QSid
face_type: z.union([z.coerce.number(), z.coerce.string()]).default('1'), face_type: z.coerce.string().default('1'),
wording: z.coerce.string().default(' '), wording: z.coerce.string().default(' '),
}); });

View File

@@ -3,7 +3,7 @@ import { ActionName } from '@/onebot/action/router';
import { z } from 'zod'; import { z } from 'zod';
const SchemaData = z.object({ const SchemaData = z.object({
group_id: z.union([z.coerce.number(), z.coerce.string()]), group_id: z.coerce.string(),
}); });
type Payload = z.infer<typeof SchemaData>; type Payload = z.infer<typeof SchemaData>;

View File

@@ -4,7 +4,7 @@ import { ChatType } from '@/core';
import { z } from 'zod'; import { z } from 'zod';
const SchemaData = z.object({ const SchemaData = z.object({
user_id: z.union([z.coerce.number(), z.coerce.string()]), user_id: z.coerce.string(),
event_type: z.coerce.number(), event_type: z.coerce.number(),
}); });

View File

@@ -3,9 +3,9 @@ import { ActionName } from '@/onebot/action/router';
import { z } from 'zod'; import { z } from 'zod';
const SchemaData = z.object({ const SchemaData = z.object({
status: z.union([z.coerce.number(), z.coerce.string()]), status: z.coerce.number(),
ext_status: z.union([z.coerce.number(), z.coerce.string()]), ext_status: z.coerce.number(),
battery_status: z.union([z.coerce.number(), z.coerce.string()]), battery_status: z.coerce.number(),
}); });
type Payload = z.infer<typeof SchemaData>; type Payload = z.infer<typeof SchemaData>;

View File

@@ -3,8 +3,8 @@ import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
import { z } from 'zod'; import { z } from 'zod';
const SchemaData = z.object({ const SchemaData = z.object({
group_id: z.union([z.coerce.number(), z.coerce.string()]), group_id: z.coerce.string(),
user_id: z.union([z.coerce.number(), z.coerce.string()]), user_id: z.coerce.string(),
special_title: z.coerce.string().default(''), special_title: z.coerce.string().default(''),
}); });

View File

@@ -4,8 +4,8 @@ import { ActionName } from '@/onebot/action/router';
import { z } from 'zod'; import { z } from 'zod';
const SchemaData = z.object({ const SchemaData = z.object({
user_id: z.union([z.coerce.number(), z.coerce.string()]).optional(), user_id: z.coerce.string().optional(),
group_id: z.union([z.coerce.number(), z.coerce.string()]).optional(), group_id: z.coerce.string().optional(),
phoneNumber: z.coerce.string().default(''), phoneNumber: z.coerce.string().default(''),
}); });
@@ -29,7 +29,7 @@ export class SharePeer extends OneBotAction<Payload, GeneralCallResult & {
} }
const SchemaDataGroupEx = z.object({ const SchemaDataGroupEx = z.object({
group_id: z.union([z.coerce.number(), z.coerce.string()]), group_id: z.coerce.string(),
}); });
type PayloadGroupEx = z.infer<typeof SchemaDataGroupEx>; type PayloadGroupEx = z.infer<typeof SchemaDataGroupEx>;

View File

@@ -4,7 +4,7 @@ import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
import { z } from 'zod'; import { z } from 'zod';
const SchemaData = z.object({ const SchemaData = z.object({
group_id: z.union([z.coerce.number(), z.coerce.string()]), group_id: z.coerce.string(),
file_id: z.coerce.string(), file_id: z.coerce.string(),
}); });

View File

@@ -4,7 +4,7 @@ import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
import { z } from 'zod'; import { z } from 'zod';
const SchemaData = z.object({ const SchemaData = z.object({
group_id: z.union([z.coerce.number(), z.coerce.string()]), group_id: z.coerce.string(),
file_id: z.coerce.string(), file_id: z.coerce.string(),
}); });

View File

@@ -3,7 +3,7 @@ import { ActionName } from '@/onebot/action/router';
import { z } from 'zod'; import { z } from 'zod';
const SchemaData = z.object({ const SchemaData = z.object({
group_id: z.union([z.coerce.number(), z.coerce.string()]), group_id: z.coerce.string(),
folder_name: z.coerce.string(), folder_name: z.coerce.string(),
}); });

View File

@@ -6,7 +6,7 @@ import { z } from 'zod';
import { NTQQGroupApi } from '@/core/apis'; import { NTQQGroupApi } from '@/core/apis';
const SchemaData = z.object({ const SchemaData = z.object({
group_id: z.union([z.coerce.number(), z.coerce.string()]), group_id: z.coerce.string(),
file_id: z.coerce.string(), file_id: z.coerce.string(),
}); });

View File

@@ -4,7 +4,7 @@ import { z } from 'zod';
import { NTQQGroupApi } from '@/core/apis'; import { NTQQGroupApi } from '@/core/apis';
const SchemaData = z.object({ const SchemaData = z.object({
group_id: z.union([z.coerce.number(), z.coerce.string()]), group_id: z.coerce.string(),
folder_id: z.coerce.string().optional(), folder_id: z.coerce.string().optional(),
folder: z.coerce.string().optional(), folder: z.coerce.string().optional(),
}); });

View File

@@ -10,9 +10,9 @@ interface Response {
messages: OB11Message[]; messages: OB11Message[];
} }
const SchemaData = z.object({ const SchemaData = z.object({
user_id: z.union([z.coerce.number(), z.coerce.string()]), user_id: z.coerce.string(),
message_seq: z.union([z.coerce.number(), z.coerce.string()]).optional(), message_seq: z.coerce.string().optional(),
count: z.union([z.coerce.number(), z.coerce.string()]).default(20), count: z.coerce.number().default(20),
reverseOrder: z.coerce.boolean().default(false) reverseOrder: z.coerce.boolean().default(false)
}); });

View File

@@ -3,7 +3,7 @@ import { ActionName } from '@/onebot/action/router';
import { z } from 'zod'; import { z } from 'zod';
const SchemaData = z.object({ const SchemaData = z.object({
group_id: z.union([z.coerce.number(), z.coerce.string()]) group_id: z.coerce.string()
}); });
type Payload = z.infer<typeof SchemaData>; type Payload = z.infer<typeof SchemaData>;

View File

@@ -3,7 +3,7 @@ import { ActionName } from '@/onebot/action/router';
import { z } from 'zod'; import { z } from 'zod';
const SchemaData = z.object({ const SchemaData = z.object({
group_id: z.union([z.coerce.number(), z.coerce.string()]) group_id: z.coerce.string()
}); });
type Payload = z.infer<typeof SchemaData>; type Payload = z.infer<typeof SchemaData>;

View File

@@ -5,10 +5,10 @@ import { OB11Construct } from '@/onebot/helper/data';
import { z } from 'zod'; import { z } from 'zod';
const SchemaData = z.object({ const SchemaData = z.object({
group_id: z.union([z.coerce.number(), z.coerce.string()]), group_id: z.coerce.string(),
folder_id: z.coerce.string().optional(), folder_id: z.coerce.string().optional(),
folder: z.coerce.string().optional(), folder: z.coerce.string().optional(),
file_count: z.union([z.coerce.number(), z.coerce.string()]).default(50), file_count: z.coerce.number().default(50),
}); });
type Payload = z.infer<typeof SchemaData>; type Payload = z.infer<typeof SchemaData>;

View File

@@ -4,7 +4,7 @@ import { ActionName } from '@/onebot/action/router';
import { z } from 'zod'; import { z } from 'zod';
const SchemaData = z.object({ const SchemaData = z.object({
group_id: z.union([z.coerce.number(), z.coerce.string()]), group_id: z.coerce.string(),
type: z.nativeEnum(WebHonorType).optional() type: z.nativeEnum(WebHonorType).optional()
}); });

View File

@@ -11,9 +11,9 @@ interface Response {
} }
const SchemaData = z.object({ const SchemaData = z.object({
group_id: z.union([z.coerce.number(), z.coerce.string()]), group_id: z.coerce.string(),
message_seq: z.union([z.coerce.number(), z.coerce.string()]).optional(), message_seq: z.coerce.string().optional(),
count: z.union([z.coerce.number(), z.coerce.string()]).default(20), count: z.coerce.number().default(20),
reverseOrder: z.coerce.boolean().default(false) reverseOrder: z.coerce.boolean().default(false)
}); });

View File

@@ -6,8 +6,8 @@ import { OB11Construct } from '@/onebot/helper/data';
import { z } from 'zod'; import { z } from 'zod';
const SchemaData = z.object({ const SchemaData = z.object({
group_id: z.union([z.coerce.number(), z.coerce.string()]), group_id: z.coerce.string(),
file_count: z.union([z.coerce.number(), z.coerce.string()]).default(50), file_count: z.coerce.number().default(50),
}); });
type Payload = z.infer<typeof SchemaData>; type Payload = z.infer<typeof SchemaData>;

View File

@@ -6,7 +6,7 @@ import { calcQQLevel } from '@/common/helper';
import { z } from 'zod'; import { z } from 'zod';
const SchemaData = z.object({ const SchemaData = z.object({
user_id: z.union([z.coerce.number(), z.coerce.string()]), user_id: z.coerce.string(),
no_cache: z.coerce.boolean().default(false), no_cache: z.coerce.boolean().default(false),
}); });

View File

@@ -3,8 +3,8 @@ import { ActionName } from '@/onebot/action/router';
import { z } from 'zod'; import { z } from 'zod';
const SchemaData = z.object({ const SchemaData = z.object({
friend_id: z.union([z.coerce.string(), z.coerce.number()]).optional(), friend_id: z.coerce.string().optional(),
user_id: z.union([z.coerce.string(), z.coerce.number()]).optional(), user_id: z.coerce.string().optional(),
temp_block: z.coerce.boolean().optional(), temp_block: z.coerce.boolean().optional(),
temp_both_del: z.coerce.boolean().optional(), temp_both_del: z.coerce.boolean().optional(),
}); });

View File

@@ -5,14 +5,14 @@ import { unlink } from 'node:fs/promises';
import { z } from 'zod'; import { z } from 'zod';
const SchemaData = z.object({ const SchemaData = z.object({
group_id: z.union([z.coerce.number(), z.coerce.string()]), group_id: z.coerce.string(),
content: z.coerce.string(), content: z.coerce.string(),
image: z.coerce.string().optional(), image: z.coerce.string().optional(),
pinned: z.union([z.coerce.number(), z.coerce.string()]).default(0), pinned: z.coerce.number().default(0),
type: z.union([z.coerce.number(), z.coerce.string()]).default(1), type: z.coerce.number().default(1),
confirm_required: z.union([z.coerce.number(), z.coerce.string()]).default(1), confirm_required: z.coerce.number().default(1),
is_show_edit_card: z.union([z.coerce.number(), z.coerce.string()]).default(0), is_show_edit_card: z.coerce.number().default(0),
tip_window_type: z.union([z.coerce.number(), z.coerce.string()]).default(0), tip_window_type: z.coerce.number().default(0),
}); });
type Payload = z.infer<typeof SchemaData>; type Payload = z.infer<typeof SchemaData>;

View File

@@ -6,7 +6,7 @@ import fs from 'node:fs/promises';
import { GeneralCallResult } from '@/core'; import { GeneralCallResult } from '@/core';
const SchemaData = z.object({ const SchemaData = z.object({
file: z.coerce.string(), file: z.coerce.string(),
group_id: z.union([z.coerce.number(), z.coerce.string()]) group_id: z.coerce.string()
}); });
type Payload = z.infer<typeof SchemaData>; type Payload = z.infer<typeof SchemaData>;

View File

@@ -6,7 +6,7 @@ import { z } from 'zod';
const SchemaData = z.object({ const SchemaData = z.object({
nickname: z.coerce.string(), nickname: z.coerce.string(),
personal_note: z.coerce.string().optional(), personal_note: z.coerce.string().optional(),
sex: z.union([z.coerce.number(), z.coerce.string()]).optional(), // 传Sex值建议传0 sex: z.coerce.string().optional(), // 传Sex值建议传0
}); });
type Payload = z.infer<typeof SchemaData>; type Payload = z.infer<typeof SchemaData>;

View File

@@ -7,7 +7,7 @@ import { SendMessageContext } from '@/onebot/api';
import { z } from 'zod'; import { z } from 'zod';
const SchemaData = z.object({ const SchemaData = z.object({
group_id: z.union([z.coerce.number(), z.coerce.string()]), group_id: z.coerce.string(),
file: z.coerce.string(), file: z.coerce.string(),
name: z.coerce.string(), name: z.coerce.string(),
folder: z.coerce.string().optional(), folder: z.coerce.string().optional(),

View File

@@ -8,7 +8,7 @@ import { ContextMode, createContext } from '@/onebot/action/msg/SendMsg';
import { z } from 'zod'; import { z } from 'zod';
const SchemaData = z.object({ const SchemaData = z.object({
user_id: z.union([z.coerce.number(), z.coerce.string()]), user_id: z.coerce.string(),
file: z.coerce.string(), file: z.coerce.string(),
name: z.coerce.string(), name: z.coerce.string(),
}); });

View File

@@ -4,7 +4,7 @@ import { MessageUnique } from '@/common/message-unique';
import { z } from 'zod'; import { z } from 'zod';
const SchemaData = z.object({ const SchemaData = z.object({
message_id: z.union([z.coerce.number(), z.coerce.string()]), message_id: z.coerce.string(),
}); });
type Payload = z.infer<typeof SchemaData>; type Payload = z.infer<typeof SchemaData>;
@@ -16,7 +16,7 @@ export default class DelEssenceMsg extends OneBotAction<Payload, unknown> {
const msg = MessageUnique.getMsgIdAndPeerByShortId(+payload.message_id); const msg = MessageUnique.getMsgIdAndPeerByShortId(+payload.message_id);
if (!msg) { if (!msg) {
const data = this.core.apis.GroupApi.essenceLRU.getValue(+payload.message_id); const data = this.core.apis.GroupApi.essenceLRU.getValue(+payload.message_id);
if(!data) throw new Error('消息不存在'); if (!data) throw new Error('消息不存在');
const { msg_seq, msg_random, group_id } = JSON.parse(data) as { msg_seq: string, msg_random: string, group_id: string }; const { msg_seq, msg_random, group_id } = JSON.parse(data) as { msg_seq: string, msg_random: string, group_id: string };
return await this.core.apis.GroupApi.removeGroupEssenceBySeq(group_id, msg_seq, msg_random); return await this.core.apis.GroupApi.removeGroupEssenceBySeq(group_id, msg_seq, msg_random);
} }

View File

@@ -3,7 +3,7 @@ import { ActionName } from '@/onebot/action/router';
import { z } from 'zod'; import { z } from 'zod';
const SchemaData = z.object({ const SchemaData = z.object({
group_id: z.union([z.coerce.number(), z.coerce.string()]), group_id: z.coerce.string(),
notice_id: z.coerce.string() notice_id: z.coerce.string()
}); });

View File

@@ -5,7 +5,7 @@ import { z } from 'zod';
const SchemaData = z.object({ const SchemaData = z.object({
character: z.coerce.string(), character: z.coerce.string(),
group_id: z.union([z.coerce.number(), z.coerce.string()]), group_id: z.coerce.string(),
text: z.coerce.string(), text: z.coerce.string(),
}); });

View File

@@ -7,7 +7,7 @@ import { z } from 'zod';
import { NetworkAdapterConfig } from '@/onebot/config/config'; import { NetworkAdapterConfig } from '@/onebot/config/config';
const SchemaData = z.object({ const SchemaData = z.object({
group_id: z.union([z.coerce.number(), z.coerce.string()]), group_id: z.coerce.string(),
}); });
type Payload = z.infer<typeof SchemaData>; type Payload = z.infer<typeof SchemaData>;

View File

@@ -5,7 +5,7 @@ import { ActionName } from '@/onebot/action/router';
import { z } from 'zod'; import { z } from 'zod';
const SchemaData = z.object({ const SchemaData = z.object({
group_id: z.union([z.coerce.number(), z.coerce.string()]), group_id: z.coerce.string(),
}); });
type Payload = z.infer<typeof SchemaData>; type Payload = z.infer<typeof SchemaData>;

View File

@@ -5,8 +5,8 @@ import { ActionName } from '@/onebot/action/router';
import { z } from 'zod'; import { z } from 'zod';
const SchemaData = z.object({ const SchemaData = z.object({
group_id: z.union([z.coerce.number(), z.coerce.string()]), group_id: z.coerce.string(),
user_id: z.union([z.coerce.number(), z.coerce.string()]), user_id: z.coerce.string(),
no_cache: z.coerce.boolean().default(false), no_cache: z.coerce.boolean().default(false),
}); });

View File

@@ -6,7 +6,7 @@ import { z } from 'zod';
import { GroupMember } from '@/core'; import { GroupMember } from '@/core';
const SchemaData = z.object({ const SchemaData = z.object({
group_id: z.union([z.coerce.number(), z.coerce.string()]), group_id: z.coerce.string(),
no_cache: z.coerce.boolean().default(false) no_cache: z.coerce.boolean().default(false)
}); });

View File

@@ -17,7 +17,7 @@ interface GroupNotice {
} }
const SchemaData = z.object({ const SchemaData = z.object({
group_id: z.union([z.coerce.number(), z.coerce.string()]), group_id: z.coerce.string(),
}); });
type Payload = z.infer<typeof SchemaData>; type Payload = z.infer<typeof SchemaData>;

View File

@@ -4,7 +4,7 @@ import { ActionName } from '@/onebot/action/router';
import { z } from 'zod'; import { z } from 'zod';
const SchemaData = z.object({ const SchemaData = z.object({
group_id: z.union([z.coerce.number(), z.coerce.string()]), group_id: z.coerce.string(),
}); });
type Payload = z.infer<typeof SchemaData>; type Payload = z.infer<typeof SchemaData>;

View File

@@ -3,8 +3,8 @@ import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
import { z } from 'zod'; import { z } from 'zod';
const SchemaData = z.object({ const SchemaData = z.object({
group_id: z.union([z.coerce.number(), z.coerce.string()]), group_id: z.coerce.string(),
user_id: z.union([z.coerce.number(), z.coerce.string()]), user_id: z.coerce.string(),
}); });
type Payload = z.infer<typeof SchemaData>; type Payload = z.infer<typeof SchemaData>;

View File

@@ -5,7 +5,7 @@ import { z } from 'zod';
const SchemaData = z.object({ const SchemaData = z.object({
character: z.coerce.string(), character: z.coerce.string(),
group_id: z.union([z.coerce.number(), z.coerce.string()]), group_id: z.coerce.string(),
text: z.coerce.string(), text: z.coerce.string(),
}); });

View File

@@ -4,7 +4,7 @@ import { MessageUnique } from '@/common/message-unique';
import { z } from 'zod'; import { z } from 'zod';
const SchemaData = z.object({ const SchemaData = z.object({
message_id: z.union([z.coerce.number(), z.coerce.string()]), message_id: z.coerce.string(),
}); });
type Payload = z.infer<typeof SchemaData>; type Payload = z.infer<typeof SchemaData>;

View File

@@ -4,9 +4,9 @@ import { ActionName } from '@/onebot/action/router';
import { z } from 'zod'; import { z } from 'zod';
const SchemaData = z.object({ const SchemaData = z.object({
flag: z.union([z.coerce.string(), z.coerce.number()]), flag: z.coerce.string(),
approve: z.coerce.boolean().default(true), approve: z.coerce.boolean().default(true),
reason: z.union([z.coerce.string(), z.null()]).default(' '), reason: z.coerce.string().nullable().default(' '),
}); });
type Payload = z.infer<typeof SchemaData>; type Payload = z.infer<typeof SchemaData>;

View File

@@ -4,8 +4,8 @@ import { ActionName } from '@/onebot/action/router';
import { z } from 'zod'; import { z } from 'zod';
const SchemaData = z.object({ const SchemaData = z.object({
group_id: z.union([z.coerce.number(), z.coerce.string()]), group_id: z.coerce.string(),
user_id: z.union([z.coerce.number(), z.coerce.string()]), user_id: z.coerce.string(),
enable: z.coerce.boolean().default(false), enable: z.coerce.boolean().default(false),
}); });

View File

@@ -3,9 +3,9 @@ import { ActionName } from '@/onebot/action/router';
import { z } from 'zod'; import { z } from 'zod';
const SchemaData = z.object({ const SchemaData = z.object({
group_id: z.union([z.coerce.number(), z.coerce.string()]), group_id: z.coerce.string(),
user_id: z.union([z.coerce.number(), z.coerce.string()]), user_id: z.coerce.string(),
duration: z.union([z.coerce.number(), z.coerce.string()]).default(0), duration: z.coerce.number().default(0),
}); });
type Payload = z.infer<typeof SchemaData>; type Payload = z.infer<typeof SchemaData>;

View File

@@ -3,8 +3,8 @@ import { ActionName } from '@/onebot/action/router';
import { z } from 'zod'; import { z } from 'zod';
const SchemaData = z.object({ const SchemaData = z.object({
group_id: z.union([z.coerce.number(), z.coerce.string()]), group_id: z.coerce.string(),
user_id: z.union([z.coerce.number(), z.coerce.string()]), user_id: z.coerce.string(),
card: z.coerce.string().optional(), card: z.coerce.string().optional(),
}); });

View File

@@ -3,9 +3,9 @@ import { ActionName } from '@/onebot/action/router';
import { z } from 'zod'; import { z } from 'zod';
const SchemaData = z.object({ const SchemaData = z.object({
group_id: z.union([z.coerce.number(), z.coerce.string()]), group_id: z.coerce.string(),
user_id: z.union([z.coerce.number(), z.coerce.string()]), user_id: z.coerce.string(),
reject_add_request: z.union([z.coerce.boolean(), z.coerce.string()]).optional(), reject_add_request: z.coerce.boolean().optional(),
}); });
type Payload = z.infer<typeof SchemaData>; type Payload = z.infer<typeof SchemaData>;

View File

@@ -3,7 +3,7 @@ import { ActionName } from '@/onebot/action/router';
import { z } from 'zod'; import { z } from 'zod';
const SchemaData = z.object({ const SchemaData = z.object({
group_id: z.union([z.coerce.number(), z.coerce.string()]), group_id: z.coerce.string(),
is_dismiss: z.coerce.boolean().optional(), is_dismiss: z.coerce.boolean().optional(),
}); });

View File

@@ -4,7 +4,7 @@ import { ActionName } from '@/onebot/action/router';
import { z } from 'zod'; import { z } from 'zod';
const SchemaData = z.object({ const SchemaData = z.object({
group_id: z.union([z.coerce.number(), z.coerce.string()]), group_id: z.coerce.string(),
group_name: z.coerce.string(), group_name: z.coerce.string(),
}); });

View File

@@ -3,8 +3,8 @@ import { ActionName } from '@/onebot/action/router';
import { z } from 'zod'; import { z } from 'zod';
const SchemaData = z.object({ const SchemaData = z.object({
group_id: z.union([z.coerce.number(), z.coerce.string()]), group_id: z.coerce.string(),
enable: z.union([z.coerce.boolean(), z.coerce.string()]).optional(), enable: z.coerce.boolean().optional(),
}); });
type Payload = z.infer<typeof SchemaData>; type Payload = z.infer<typeof SchemaData>;

View File

@@ -4,7 +4,7 @@ import { MessageUnique } from '@/common/message-unique';
import { z } from 'zod'; import { z } from 'zod';
const SchemaData = z.object({ const SchemaData = z.object({
message_id: z.union([z.coerce.number(), z.coerce.string()]), message_id: z.coerce.string(),
}); });
type Payload = z.infer<typeof SchemaData>; type Payload = z.infer<typeof SchemaData>;

View File

@@ -5,7 +5,7 @@ import { MessageUnique } from '@/common/message-unique';
import { z } from 'zod'; import { z } from 'zod';
const SchemaData = z.object({ const SchemaData = z.object({
message_id: z.union([z.coerce.number(), z.coerce.string()]), message_id: z.coerce.string(),
group_id: z.coerce.string().optional(), group_id: z.coerce.string().optional(),
user_id: z.coerce.string().optional(), user_id: z.coerce.string().optional(),
}); });

View File

@@ -9,7 +9,7 @@ import { NetworkAdapterConfig } from '@/onebot/config/config';
export type ReturnDataType = OB11Message export type ReturnDataType = OB11Message
const SchemaData = z.object({ const SchemaData = z.object({
message_id: z.union([z.coerce.number(), z.coerce.string()]), message_id: z.coerce.string(),
}); });
type Payload = z.infer<typeof SchemaData>; type Payload = z.infer<typeof SchemaData>;
@@ -29,7 +29,7 @@ class GetMsg extends OneBotAction<Payload, OB11Message> {
} }
const peer = { guildId: '', peerUid: msgIdWithPeer?.Peer.peerUid, chatType: msgIdWithPeer.Peer.chatType }; const peer = { guildId: '', peerUid: msgIdWithPeer?.Peer.peerUid, chatType: msgIdWithPeer.Peer.chatType };
const orimsg = this.obContext.recallMsgCache.get(msgIdWithPeer.MsgId); const orimsg = this.obContext.recallMsgCache.get(msgIdWithPeer.MsgId);
let msg: RawMessage|undefined; let msg: RawMessage | undefined;
if (orimsg) { if (orimsg) {
msg = orimsg; msg = orimsg;
} else { } else {

View File

@@ -5,9 +5,9 @@ import { MessageUnique } from '@/common/message-unique';
import { z } from 'zod'; import { z } from 'zod';
const SchemaData = z.object({ const SchemaData = z.object({
user_id: z.union([z.coerce.string(), z.coerce.number()]).optional(), user_id: z.coerce.string().optional(),
group_id: z.union([z.coerce.string(), z.coerce.number()]).optional(), group_id: z.coerce.string().optional(),
message_id: z.union([z.coerce.string(), z.coerce.number()]).optional(), message_id: z.coerce.string().optional(),
}); });
type PlayloadType = z.infer<typeof SchemaData>; type PlayloadType = z.infer<typeof SchemaData>;

View File

@@ -4,8 +4,8 @@ import { MessageUnique } from '@/common/message-unique';
import { z } from 'zod'; import { z } from 'zod';
const SchemaData = z.object({ const SchemaData = z.object({
message_id: z.union([z.coerce.number(), z.coerce.string()]), message_id: z.coerce.string(),
emoji_id: z.union([z.coerce.number(), z.coerce.string()]), emoji_id: z.coerce.string(),
set: z.coerce.boolean().optional(), set: z.coerce.boolean().optional(),
}); });

View File

@@ -3,8 +3,8 @@ import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
import { z } from 'zod'; import { z } from 'zod';
const SchemaData = z.object({ const SchemaData = z.object({
group_id: z.union([z.coerce.number(), z.coerce.string()]).optional(), group_id: z.coerce.string().optional(),
user_id: z.union([z.coerce.number(), z.coerce.string()]), user_id: z.coerce.string(),
}); });
type Payload = z.infer<typeof SchemaData>; type Payload = z.infer<typeof SchemaData>;

View File

@@ -3,7 +3,7 @@ import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
import { z } from 'zod'; import { z } from 'zod';
const SchemaData = z.object({ const SchemaData = z.object({
user_id: z.union([z.coerce.number(), z.coerce.string()]) user_id: z.coerce.string()
}); });
type Payload = z.infer<typeof SchemaData>; type Payload = z.infer<typeof SchemaData>;

View File

@@ -3,8 +3,8 @@ import { ActionName } from '@/onebot/action/router';
import { z } from 'zod'; import { z } from 'zod';
const SchemaData = z.object({ const SchemaData = z.object({
times: z.union([z.coerce.number(), z.coerce.string()]).default(1), times: z.coerce.number().default(1),
user_id: z.union([z.coerce.number(), z.coerce.string()]) user_id: z.coerce.string()
}); });
type Payload = z.infer<typeof SchemaData>; type Payload = z.infer<typeof SchemaData>;

View File

@@ -3,9 +3,9 @@ import { ActionName } from '@/onebot/action/router';
import { z } from 'zod'; import { z } from 'zod';
const SchemaData = z.object({ const SchemaData = z.object({
flag: z.union([z.coerce.string(), z.coerce.number()]), flag: z.coerce.string(),
approve: z.union([z.coerce.string(), z.coerce.boolean()]).default(true), approve: z.coerce.boolean().default(true),
remark: z.union([z.coerce.string(), z.null()]).nullable().optional() remark: z.coerce.string().nullable().optional()
}); });
type Payload = z.infer<typeof SchemaData>; type Payload = z.infer<typeof SchemaData>;