mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-03-01 08:10:25 +00:00
fix: checker
This commit is contained in:
@@ -4,7 +4,7 @@ import { MessageUnique } from '@/common/message-unique';
|
||||
import { z } from 'zod';
|
||||
|
||||
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>;
|
||||
@@ -16,7 +16,7 @@ export default class DelEssenceMsg extends OneBotAction<Payload, unknown> {
|
||||
const msg = MessageUnique.getMsgIdAndPeerByShortId(+payload.message_id);
|
||||
if (!msg) {
|
||||
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 };
|
||||
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';
|
||||
|
||||
const SchemaData = z.object({
|
||||
group_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||
group_id: z.coerce.string(),
|
||||
notice_id: z.coerce.string()
|
||||
});
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import { z } from 'zod';
|
||||
|
||||
const SchemaData = z.object({
|
||||
character: z.coerce.string(),
|
||||
group_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||
group_id: z.coerce.string(),
|
||||
text: z.coerce.string(),
|
||||
});
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import { z } from 'zod';
|
||||
import { NetworkAdapterConfig } from '@/onebot/config/config';
|
||||
|
||||
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>;
|
||||
|
||||
@@ -5,7 +5,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.coerce.string(),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -5,8 +5,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()]),
|
||||
user_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||
group_id: z.coerce.string(),
|
||||
user_id: z.coerce.string(),
|
||||
no_cache: z.coerce.boolean().default(false),
|
||||
});
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import { z } from 'zod';
|
||||
import { GroupMember } from '@/core';
|
||||
|
||||
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)
|
||||
});
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ interface GroupNotice {
|
||||
}
|
||||
|
||||
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>;
|
||||
|
||||
@@ -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.coerce.string(),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -3,8 +3,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()]),
|
||||
user_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||
group_id: z.coerce.string(),
|
||||
user_id: z.coerce.string(),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -5,7 +5,7 @@ import { z } from 'zod';
|
||||
|
||||
const SchemaData = z.object({
|
||||
character: z.coerce.string(),
|
||||
group_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||
group_id: z.coerce.string(),
|
||||
text: z.coerce.string(),
|
||||
});
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import { MessageUnique } from '@/common/message-unique';
|
||||
import { z } from 'zod';
|
||||
|
||||
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>;
|
||||
|
||||
@@ -4,9 +4,9 @@ import { ActionName } from '@/onebot/action/router';
|
||||
import { z } from 'zod';
|
||||
|
||||
const SchemaData = z.object({
|
||||
flag: z.union([z.coerce.string(), z.coerce.number()]),
|
||||
flag: z.coerce.string(),
|
||||
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>;
|
||||
|
||||
@@ -4,8 +4,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()]),
|
||||
user_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||
group_id: z.coerce.string(),
|
||||
user_id: z.coerce.string(),
|
||||
enable: z.coerce.boolean().default(false),
|
||||
});
|
||||
|
||||
|
||||
@@ -3,9 +3,9 @@ import { ActionName } from '@/onebot/action/router';
|
||||
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()]),
|
||||
duration: z.union([z.coerce.number(), z.coerce.string()]).default(0),
|
||||
group_id: z.coerce.string(),
|
||||
user_id: z.coerce.string(),
|
||||
duration: z.coerce.number().default(0),
|
||||
});
|
||||
|
||||
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.union([z.coerce.number(), z.coerce.string()]),
|
||||
user_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||
group_id: z.coerce.string(),
|
||||
user_id: z.coerce.string(),
|
||||
card: z.coerce.string().optional(),
|
||||
});
|
||||
|
||||
|
||||
@@ -3,9 +3,9 @@ import { ActionName } from '@/onebot/action/router';
|
||||
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()]),
|
||||
reject_add_request: z.union([z.coerce.boolean(), z.coerce.string()]).optional(),
|
||||
group_id: z.coerce.string(),
|
||||
user_id: z.coerce.string(),
|
||||
reject_add_request: z.coerce.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({
|
||||
group_id: z.union([z.coerce.number(), z.coerce.string()]),
|
||||
group_id: z.coerce.string(),
|
||||
is_dismiss: z.coerce.boolean().optional(),
|
||||
});
|
||||
|
||||
|
||||
@@ -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.coerce.string(),
|
||||
group_name: z.coerce.string(),
|
||||
});
|
||||
|
||||
|
||||
@@ -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()]),
|
||||
enable: z.union([z.coerce.boolean(), z.coerce.string()]).optional(),
|
||||
group_id: z.coerce.string(),
|
||||
enable: z.coerce.boolean().optional(),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
Reference in New Issue
Block a user