mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-07-19 12:03:37 +00:00
@@ -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.coerce.string(),
|
group_id: z.union([z.coerce.number(), 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(),
|
||||||
|
@@ -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.coerce.string(),
|
group_id: z.union([z.coerce.number(), 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(),
|
||||||
|
@@ -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.coerce.string(),// 参考 face_config.json 的 QSid
|
face_id: z.union([z.coerce.number(), z.coerce.string()]),// 参考 face_config.json 的 QSid
|
||||||
face_type: z.coerce.string().default('1'),
|
face_type: z.union([z.coerce.number(), z.coerce.string()]).default('1'),
|
||||||
wording: z.coerce.string().default(' '),
|
wording: z.coerce.string().default(' '),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -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.coerce.string(),
|
group_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||||
});
|
});
|
||||||
|
|
||||||
type Payload = z.infer<typeof SchemaData>;
|
type Payload = z.infer<typeof SchemaData>;
|
||||||
|
@@ -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.coerce.string(),
|
user_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||||
event_type: z.coerce.number(),
|
event_type: z.coerce.number(),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -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.coerce.number(),
|
status: z.union([z.coerce.number(), z.coerce.string()]),
|
||||||
ext_status: z.coerce.number(),
|
ext_status: z.union([z.coerce.number(), z.coerce.string()]),
|
||||||
battery_status: z.coerce.number(),
|
battery_status: z.union([z.coerce.number(), z.coerce.string()]),
|
||||||
});
|
});
|
||||||
|
|
||||||
type Payload = z.infer<typeof SchemaData>;
|
type Payload = z.infer<typeof SchemaData>;
|
||||||
|
@@ -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.coerce.string(),
|
group_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||||
user_id: z.coerce.string(),
|
user_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||||
special_title: z.coerce.string().default(''),
|
special_title: z.coerce.string().default(''),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -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.coerce.string().optional(),
|
user_id: z.union([z.coerce.number(), z.coerce.string()]).optional(),
|
||||||
group_id: z.coerce.string().optional(),
|
group_id: z.union([z.coerce.number(), 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.coerce.string(),
|
group_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||||
});
|
});
|
||||||
|
|
||||||
type PayloadGroupEx = z.infer<typeof SchemaDataGroupEx>;
|
type PayloadGroupEx = z.infer<typeof SchemaDataGroupEx>;
|
||||||
|
@@ -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.coerce.string(),
|
group_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||||
file_id: z.coerce.string(),
|
file_id: z.coerce.string(),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -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.coerce.string(),
|
group_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||||
file_id: z.coerce.string(),
|
file_id: z.coerce.string(),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -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.coerce.string(),
|
group_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||||
folder_name: z.coerce.string(),
|
folder_name: z.coerce.string(),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -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.coerce.string(),
|
group_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||||
file_id: z.coerce.string(),
|
file_id: z.coerce.string(),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -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.coerce.string(),
|
group_id: z.union([z.coerce.number(), 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(),
|
||||||
});
|
});
|
||||||
|
@@ -10,9 +10,9 @@ interface Response {
|
|||||||
messages: OB11Message[];
|
messages: OB11Message[];
|
||||||
}
|
}
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
user_id: z.coerce.string(),
|
user_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||||
message_seq: z.coerce.string().optional(),
|
message_seq: z.union([z.coerce.number(), z.coerce.string()]).optional(),
|
||||||
count: z.coerce.number().default(20),
|
count: z.union([z.coerce.number(), z.coerce.string()]).default(20),
|
||||||
reverseOrder: z.coerce.boolean().default(false)
|
reverseOrder: z.coerce.boolean().default(false)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -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.coerce.string()
|
group_id: z.union([z.coerce.number(), z.coerce.string()])
|
||||||
});
|
});
|
||||||
|
|
||||||
type Payload = z.infer<typeof SchemaData>;
|
type Payload = z.infer<typeof SchemaData>;
|
||||||
|
@@ -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.coerce.string()
|
group_id: z.union([z.coerce.number(), z.coerce.string()])
|
||||||
});
|
});
|
||||||
|
|
||||||
type Payload = z.infer<typeof SchemaData>;
|
type Payload = z.infer<typeof SchemaData>;
|
||||||
|
@@ -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.coerce.string(),
|
group_id: z.union([z.coerce.number(), 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.coerce.number().default(50),
|
file_count: z.union([z.coerce.number(), z.coerce.string()]).default(50),
|
||||||
});
|
});
|
||||||
|
|
||||||
type Payload = z.infer<typeof SchemaData>;
|
type Payload = z.infer<typeof SchemaData>;
|
||||||
|
@@ -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.coerce.string(),
|
group_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||||
type: z.nativeEnum(WebHonorType).optional()
|
type: z.nativeEnum(WebHonorType).optional()
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -11,9 +11,9 @@ interface Response {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
group_id: z.coerce.string(),
|
group_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||||
message_seq: z.coerce.string().optional(),
|
message_seq: z.union([z.coerce.number(), z.coerce.string()]).optional(),
|
||||||
count: z.coerce.number().default(20),
|
count: z.union([z.coerce.number(), z.coerce.string()]).default(20),
|
||||||
reverseOrder: z.coerce.boolean().default(false)
|
reverseOrder: z.coerce.boolean().default(false)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -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.coerce.string(),
|
group_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||||
file_count: z.coerce.number().default(50),
|
file_count: z.union([z.coerce.number(), z.coerce.string()]).default(50),
|
||||||
});
|
});
|
||||||
|
|
||||||
type Payload = z.infer<typeof SchemaData>;
|
type Payload = z.infer<typeof SchemaData>;
|
||||||
|
@@ -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.coerce.string(),
|
user_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||||
no_cache: z.coerce.boolean().default(false),
|
no_cache: z.coerce.boolean().default(false),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -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.coerce.string().optional(),
|
friend_id: z.union([z.coerce.string(), z.coerce.number()]).optional(),
|
||||||
user_id: z.coerce.string().optional(),
|
user_id: z.union([z.coerce.string(), z.coerce.number()]).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(),
|
||||||
});
|
});
|
||||||
|
@@ -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.coerce.string(),
|
group_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||||
content: z.coerce.string(),
|
content: z.coerce.string(),
|
||||||
image: z.coerce.string().optional(),
|
image: z.coerce.string().optional(),
|
||||||
pinned: z.coerce.number().default(0),
|
pinned: z.union([z.coerce.number(), z.coerce.string()]).default(0),
|
||||||
type: z.coerce.number().default(1),
|
type: z.union([z.coerce.number(), z.coerce.string()]).default(1),
|
||||||
confirm_required: z.coerce.number().default(1),
|
confirm_required: z.union([z.coerce.number(), z.coerce.string()]).default(1),
|
||||||
is_show_edit_card: z.coerce.number().default(0),
|
is_show_edit_card: z.union([z.coerce.number(), z.coerce.string()]).default(0),
|
||||||
tip_window_type: z.coerce.number().default(0),
|
tip_window_type: z.union([z.coerce.number(), z.coerce.string()]).default(0),
|
||||||
});
|
});
|
||||||
|
|
||||||
type Payload = z.infer<typeof SchemaData>;
|
type Payload = z.infer<typeof SchemaData>;
|
||||||
|
@@ -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.coerce.string()
|
group_id: z.union([z.coerce.number(), z.coerce.string()])
|
||||||
});
|
});
|
||||||
|
|
||||||
type Payload = z.infer<typeof SchemaData>;
|
type Payload = z.infer<typeof SchemaData>;
|
||||||
|
@@ -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.coerce.string().optional(), // 传Sex值?建议传0
|
sex: z.union([z.coerce.number(), z.coerce.string()]).optional(), // 传Sex值?建议传0
|
||||||
});
|
});
|
||||||
|
|
||||||
type Payload = z.infer<typeof SchemaData>;
|
type Payload = z.infer<typeof SchemaData>;
|
||||||
|
@@ -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.coerce.string(),
|
group_id: z.union([z.coerce.number(), 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(),
|
||||||
|
@@ -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.coerce.string(),
|
user_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||||
file: z.coerce.string(),
|
file: z.coerce.string(),
|
||||||
name: z.coerce.string(),
|
name: z.coerce.string(),
|
||||||
});
|
});
|
||||||
|
@@ -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.coerce.string(),
|
message_id: z.union([z.coerce.number(), 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);
|
||||||
}
|
}
|
||||||
|
@@ -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.coerce.string(),
|
group_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||||
notice_id: z.coerce.string()
|
notice_id: z.coerce.string()
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -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.coerce.string(),
|
group_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||||
text: z.coerce.string(),
|
text: z.coerce.string(),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -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.coerce.string(),
|
group_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||||
});
|
});
|
||||||
|
|
||||||
type Payload = z.infer<typeof SchemaData>;
|
type Payload = z.infer<typeof SchemaData>;
|
||||||
|
@@ -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.coerce.string(),
|
group_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||||
});
|
});
|
||||||
|
|
||||||
type Payload = z.infer<typeof SchemaData>;
|
type Payload = z.infer<typeof SchemaData>;
|
||||||
|
@@ -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.coerce.string(),
|
group_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||||
user_id: z.coerce.string(),
|
user_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||||
no_cache: z.coerce.boolean().default(false),
|
no_cache: z.coerce.boolean().default(false),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -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.coerce.string(),
|
group_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||||
no_cache: z.coerce.boolean().default(false)
|
no_cache: z.coerce.boolean().default(false)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -17,7 +17,7 @@ interface GroupNotice {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
group_id: z.coerce.string(),
|
group_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||||
});
|
});
|
||||||
|
|
||||||
type Payload = z.infer<typeof SchemaData>;
|
type Payload = z.infer<typeof SchemaData>;
|
||||||
|
@@ -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.coerce.string(),
|
group_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||||
});
|
});
|
||||||
|
|
||||||
type Payload = z.infer<typeof SchemaData>;
|
type Payload = z.infer<typeof SchemaData>;
|
||||||
|
@@ -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.coerce.string(),
|
group_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||||
user_id: z.coerce.string(),
|
user_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||||
});
|
});
|
||||||
|
|
||||||
type Payload = z.infer<typeof SchemaData>;
|
type Payload = z.infer<typeof SchemaData>;
|
||||||
|
@@ -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.coerce.string(),
|
group_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||||
text: z.coerce.string(),
|
text: z.coerce.string(),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -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.coerce.string(),
|
message_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||||
});
|
});
|
||||||
|
|
||||||
type Payload = z.infer<typeof SchemaData>;
|
type Payload = z.infer<typeof SchemaData>;
|
||||||
|
@@ -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.coerce.string(),
|
flag: z.union([z.coerce.string(), z.coerce.number()]),
|
||||||
approve: z.coerce.boolean().default(true),
|
approve: z.coerce.boolean().default(true),
|
||||||
reason: z.coerce.string().nullable().default(' '),
|
reason: z.union([z.coerce.string(), z.null()]).default(' '),
|
||||||
});
|
});
|
||||||
|
|
||||||
type Payload = z.infer<typeof SchemaData>;
|
type Payload = z.infer<typeof SchemaData>;
|
||||||
|
@@ -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.coerce.string(),
|
group_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||||
user_id: z.coerce.string(),
|
user_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||||
enable: z.coerce.boolean().default(false),
|
enable: z.coerce.boolean().default(false),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -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.coerce.string(),
|
group_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||||
user_id: z.coerce.string(),
|
user_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||||
duration: z.coerce.number().default(0),
|
duration: z.union([z.coerce.number(), z.coerce.string()]).default(0),
|
||||||
});
|
});
|
||||||
|
|
||||||
type Payload = z.infer<typeof SchemaData>;
|
type Payload = z.infer<typeof SchemaData>;
|
||||||
|
@@ -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.coerce.string(),
|
group_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||||
user_id: z.coerce.string(),
|
user_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||||
card: z.coerce.string().optional(),
|
card: z.coerce.string().optional(),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -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.coerce.string(),
|
group_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||||
user_id: z.coerce.string(),
|
user_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||||
reject_add_request: z.coerce.boolean().optional(),
|
reject_add_request: z.union([z.coerce.boolean(), z.coerce.string()]).optional(),
|
||||||
});
|
});
|
||||||
|
|
||||||
type Payload = z.infer<typeof SchemaData>;
|
type Payload = z.infer<typeof SchemaData>;
|
||||||
|
@@ -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.coerce.string(),
|
group_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||||
is_dismiss: z.coerce.boolean().optional(),
|
is_dismiss: z.coerce.boolean().optional(),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -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.coerce.string(),
|
group_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||||
group_name: z.coerce.string(),
|
group_name: z.coerce.string(),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -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.coerce.string(),
|
group_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||||
enable: z.coerce.boolean().optional(),
|
enable: z.union([z.coerce.boolean(), z.coerce.string()]).optional(),
|
||||||
});
|
});
|
||||||
|
|
||||||
type Payload = z.infer<typeof SchemaData>;
|
type Payload = z.infer<typeof SchemaData>;
|
||||||
|
@@ -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.coerce.string(),
|
message_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||||
});
|
});
|
||||||
|
|
||||||
type Payload = z.infer<typeof SchemaData>;
|
type Payload = z.infer<typeof SchemaData>;
|
||||||
|
@@ -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.coerce.string(),
|
message_id: z.union([z.coerce.number(), 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(),
|
||||||
});
|
});
|
||||||
|
@@ -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.coerce.string(),
|
message_id: z.union([z.coerce.number(), 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 {
|
||||||
|
@@ -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.coerce.string().optional(),
|
user_id: z.union([z.coerce.string(), z.coerce.number()]).optional(),
|
||||||
group_id: z.coerce.string().optional(),
|
group_id: z.union([z.coerce.string(), z.coerce.number()]).optional(),
|
||||||
message_id: z.coerce.string().optional(),
|
message_id: z.union([z.coerce.string(), z.coerce.number()]).optional(),
|
||||||
});
|
});
|
||||||
|
|
||||||
type PlayloadType = z.infer<typeof SchemaData>;
|
type PlayloadType = z.infer<typeof SchemaData>;
|
||||||
|
@@ -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.coerce.string(),
|
message_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||||
emoji_id: z.coerce.string(),
|
emoji_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||||
set: z.coerce.boolean().optional(),
|
set: z.coerce.boolean().optional(),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -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.coerce.string().optional(),
|
group_id: z.union([z.coerce.number(), z.coerce.string()]).optional(),
|
||||||
user_id: z.coerce.string(),
|
user_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||||
});
|
});
|
||||||
|
|
||||||
type Payload = z.infer<typeof SchemaData>;
|
type Payload = z.infer<typeof SchemaData>;
|
||||||
|
@@ -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.coerce.string()
|
user_id: z.union([z.coerce.number(), z.coerce.string()])
|
||||||
});
|
});
|
||||||
|
|
||||||
type Payload = z.infer<typeof SchemaData>;
|
type Payload = z.infer<typeof SchemaData>;
|
||||||
|
@@ -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.coerce.number().default(1),
|
times: z.union([z.coerce.number(), z.coerce.string()]).default(1),
|
||||||
user_id: z.coerce.string()
|
user_id: z.union([z.coerce.number(), z.coerce.string()])
|
||||||
});
|
});
|
||||||
|
|
||||||
type Payload = z.infer<typeof SchemaData>;
|
type Payload = z.infer<typeof SchemaData>;
|
||||||
|
@@ -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.coerce.string(),
|
flag: z.union([z.coerce.string(), z.coerce.number()]),
|
||||||
approve: z.coerce.boolean().default(true),
|
approve: z.union([z.coerce.string(), z.coerce.boolean()]).default(true),
|
||||||
remark: z.coerce.string().nullable().optional()
|
remark: z.union([z.coerce.string(), z.null()]).nullable().optional()
|
||||||
});
|
});
|
||||||
|
|
||||||
type Payload = z.infer<typeof SchemaData>;
|
type Payload = z.infer<typeof SchemaData>;
|
||||||
|
Reference in New Issue
Block a user