mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-12 07:50: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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user