From afa06f076059889b5f485127a729773dd42574b3 Mon Sep 17 00:00:00 2001 From: idranme Date: Sun, 22 Sep 2024 21:18:59 +0800 Subject: [PATCH] fix --- src/ntqqapi/api/msg.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ntqqapi/api/msg.ts b/src/ntqqapi/api/msg.ts index 80e4d38..e119444 100644 --- a/src/ntqqapi/api/msg.ts +++ b/src/ntqqapi/api/msg.ts @@ -267,6 +267,12 @@ export class NTQQMsgApi extends Service { } async generateMsgUniqueId(chatType: number) { - return await invoke('nodeIKernelMsgService/generateMsgUniqueId', [{ chatType }]) + const uniqueId = await invoke('nodeIKernelMsgService/generateMsgUniqueId', [{ chatType }]) + if (typeof uniqueId === 'string') { + return uniqueId + } else { + const random = Math.trunc(Math.random() * 100) + return `${Date.now()}${random}` + } } }