diff --git a/src/core/src/services/NodeIKernelRichMediaService.ts b/src/core/src/services/NodeIKernelRichMediaService.ts index 8e6cc397..13dd8fd7 100644 --- a/src/core/src/services/NodeIKernelRichMediaService.ts +++ b/src/core/src/services/NodeIKernelRichMediaService.ts @@ -159,7 +159,7 @@ export interface NodeIKernelRichMediaService { fileName: string, fileSize: string, fileModelId: string - }[]): unknown; + }[]): Promise; downloadFileByUrlList(fileDownloadTyp: UrlFileDownloadType, urlList: Array): unknown; diff --git a/src/onebot11/action/msg/SendMsg/index.ts b/src/onebot11/action/msg/SendMsg/index.ts index 64dc92a6..91a75eb0 100644 --- a/src/onebot11/action/msg/SendMsg/index.ts +++ b/src/onebot11/action/msg/SendMsg/index.ts @@ -170,7 +170,7 @@ export class SendMsg extends BaseAction { // log("send msg:", peer, sendElements) const { sendElements, deleteAfterSentFiles } = await createSendElements(messages, group); - //console.log(peer, JSON.stringify(sendElements,null,2)); + console.log(peer, JSON.stringify(sendElements,null,2)); const returnMsg = await sendMsg(peer, sendElements, deleteAfterSentFiles); return { message_id: returnMsg!.id! }; } diff --git a/src/onebot11/action/msg/SetMsgEmojiLike.ts b/src/onebot11/action/msg/SetMsgEmojiLike.ts index fff40dc2..edb8edcc 100644 --- a/src/onebot11/action/msg/SetMsgEmojiLike.ts +++ b/src/onebot11/action/msg/SetMsgEmojiLike.ts @@ -7,8 +7,8 @@ import { MessageUnique } from '@/common/utils/MessageUnique'; const SchemaData = { type: 'object', properties: { - message_id: { type: ['string','number'] }, - emoji_id: { type: ['string','number'] } + message_id: { type: ['string', 'number'] }, + emoji_id: { type: ['string', 'number'] } }, required: ['message_id', 'emoji_id'] } as const satisfies JSONSchema; @@ -23,10 +23,13 @@ export class SetMsgEmojiLike extends BaseAction { if (!msg) { throw new Error('msg not found'); } - if (!payload.emoji_id){ + if (!payload.emoji_id) { throw new Error('emojiId not found'); } - const msgSeq = (await NTQQMsgApi.getMsgsByMsgId(msg.Peer, [msg.MsgId])).msgList[0].msgSeq; - return await NTQQMsgApi.setEmojiLike(msg.Peer, msgSeq, payload.emoji_id.toString(), true); + const msgData = (await NTQQMsgApi.getMsgsByMsgId(msg.Peer, [msg.MsgId])).msgList; + if (!msgData || msgData.length == 0 || !msgData[0].msgSeq) { + throw new Error('find msg by msgid error'); + } + return await NTQQMsgApi.setEmojiLike(msg.Peer, msgData[0].msgSeq, payload.emoji_id.toString(), true); } } diff --git a/vite.config.ts b/vite.config.ts index 7fd34a7f..adf9cbb3 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -28,7 +28,7 @@ if (process.env.NAPCAT_BUILDSYS == 'linux') { } startScripts = ['./script/dbghelp.dll', './script/BootWay05-utf8.ps1', './script/BootWay05.ps1', './script/napcat-9912.ps1', './script/napcat-9912-utf8.ps1', './script/napcat-9912.bat', './script/napcat-9912-utf8.bat']; } else { - startScripts = ['./script/napcat.sh', './script/napcat.ps1', './script/napcat.bat', './script/napcat-utf8.bat', './script/napcat-utf8.ps1', './script/napcat-log.ps1', './script/napcat-9912.ps1', './script/napcat-9912-utf8.ps1', './script/napcat-9912.bat', './script/napcat-9912-utf8.bat']; + startScripts = ['./script/BootWay05-utf8.ps1', './script/BootWay05.ps1', './script/napcat.sh', './script/napcat.ps1', './script/napcat.bat', './script/napcat-utf8.bat', './script/napcat-utf8.ps1', './script/napcat-log.ps1', './script/napcat-9912.ps1', './script/napcat-9912-utf8.ps1', './script/napcat-9912.bat', './script/napcat-9912-utf8.bat']; } const baseConfigPlugin: PluginOption[] = [