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 { 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);
}

View File

@@ -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()
});

View File

@@ -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(),
});

View File

@@ -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>;

View File

@@ -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>;

View File

@@ -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),
});

View File

@@ -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)
});

View File

@@ -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>;

View File

@@ -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>;

View File

@@ -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>;

View File

@@ -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(),
});

View File

@@ -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>;

View File

@@ -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>;

View File

@@ -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),
});

View File

@@ -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>;

View File

@@ -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(),
});

View File

@@ -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>;

View File

@@ -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(),
});

View File

@@ -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(),
});

View File

@@ -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>;