chore: 🥹LocalMsg不会写入数据库

This commit is contained in:
手瓜一十雪 2024-07-28 16:23:56 +08:00
parent df081ef0cf
commit 950ddc749e
3 changed files with 15 additions and 4 deletions

View File

@ -158,7 +158,7 @@ export class NTEventWrapper {
let retEvent: any = {};
const databack = () => {
if (complete == 0) {
reject(new Error('NTEvent EventName:' + EventName + ' ListenerName:' + ListenerName + ' timeout'));
reject(new Error('Timeout: NTEvent EventName:' + EventName + ' ListenerName:' + ListenerName + ' EventRet:\n' + JSON.stringify(retEvent, null, 4) + '\n'));
} else {
resolve([retEvent as Awaited<ReturnType<EventType>>, ...retData!]);
}

View File

@ -1,4 +1,4 @@
import { GetFileListParam, Peer, RawMessage, SendMessageElement } from '@/core/entities';
import { ElementType, GetFileListParam, MessageElement, Peer, RawMessage, SendMessageElement, SendMsgElementConstructor } from '@/core/entities';
import { friends, groups, selfInfo } from '@/core/data';
import { log, logWarn } from '@/common/utils/log';
import { sleep } from '@/common/utils/helper';
@ -41,7 +41,18 @@ setTimeout(() => {
loadMessageUnique().then().catch();
});
}, 100);
// setTimeout(async () => {
// let ele: MessageElement = {extBufForUI: '0x' ,...SendMsgElementConstructor.text('测试消息')};
// let MsgId = await NTQQMsgApi.getMsgUniqueEx();
// let peer ={ chatType: 2, peerUid: '809079648', guildId: '' };
// console.log(await napCatCore.session.getMsgService().addLocalRecordMsg(
// peer,
// MsgId,
// ele, [], true
// ));
// console.log(await NTQQMsgApi.multiForwardMsg(peer,peer,[MsgId]));
// }, 25000)
export class NTQQMsgApi {
// static napCatCore: NapCatCore | null = null;
// enum BaseEmojiType {
@ -142,7 +153,7 @@ export class NTQQMsgApi {
});
return retMsg;
}
static async getMsgUniqueEx(){
static async getMsgUniqueEx() {
let msgId = await NTQQMsgApi.getMsgUnique(await NTQQMsgApi.getServerTime());
return msgId;
}

View File

@ -392,7 +392,7 @@ export interface MessageElement {
avRecordElement?: AvRecordElement,
structMsgElement?: null,
faceBubbleElement?: FaceBubbleElement,
shareLocationElement: ShareLocationElement,
shareLocationElement?: ShareLocationElement,
tofuRecordElement?: TofuRecordElement,
taskTopMsgElement?: TaskTopMsgElement,
recommendedMsgElement?: RecommendedMsgElement,