refactor: msgId stage-2

This commit is contained in:
手瓜一十雪 committed 2024-07-22 11:34:18 +08:00
1 parent a8554878ac
commit ee6925edf9
9 files changed
+22 -31

No files matched your search

@@ -1,11 +1,9 @@
import BaseAction from '../BaseAction';
import { OB11ForwardMessage, OB11Message, OB11MessageData } from '../../types';
import { NTQQMsgApi } from '@/core/apis';
import { dbUtil } from '@/common/utils/db';
import { OB11Constructor } from '../../constructor';
import { ActionName, BaseCheckResult } from '../types';
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
import Ajv from 'ajv';
import { MessageUnique } from '@/common/utils/MessageUnique';
const SchemaData = {
@@ -42,7 +40,7 @@ export class GoCQHTTPGetForwardMsgAction extends BaseAction<Payload, any> {
const msgList = data.msgList;
const messages = await Promise.all(msgList.map(async msg => {
const resMsg = await OB11Constructor.message(msg);
resMsg.message_id = await dbUtil.addMsg(msg);
resMsg.message_id = await MessageUnique.createMsg({guildId:'',chatType:msg.chatType,peerUid:msg.peerUid},msg.msgId)!;
return resMsg;
}));
messages.map(msg => {