diff --git a/manifest.json b/manifest.json index a0da57af..4ca13617 100644 --- a/manifest.json +++ b/manifest.json @@ -4,7 +4,7 @@ "name": "NapCatQQ", "slug": "NapCat.Framework", "description": "高性能的 OneBot 11 协议实现", - "version": "2.2.39", + "version": "2.2.40", "icon": "./logo.png", "authors": [ { diff --git a/package.json b/package.json index 52ff6fa4..8696d4eb 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "napcat", "private": true, "type": "module", - "version": "2.2.39", + "version": "2.2.40", "scripts": { "build:framework": "vite build --mode framework", "build:shell": "vite build --mode shell", diff --git a/src/common/version.ts b/src/common/version.ts index 5e35740f..eab85f5d 100644 --- a/src/common/version.ts +++ b/src/common/version.ts @@ -1 +1 @@ -export const napCatVersion = '2.2.39'; +export const napCatVersion = '2.2.40'; diff --git a/src/core/apis/msg.ts b/src/core/apis/msg.ts index c4e98c28..1fd0c98a 100644 --- a/src/core/apis/msg.ts +++ b/src/core/apis/msg.ts @@ -93,6 +93,18 @@ export class NTQQMsgApi { pageLimit: 1, }); } + async queryFirstMsgBySeq(peer: Peer, msgSeq: string) { + return await this.context.session.getMsgService().queryMsgsWithFilterEx('0', '0', msgSeq, { + chatInfo: peer, + filterMsgType: [], + filterSendersUid: [], + filterMsgToTime: '0', + filterMsgFromTime: '0', + isReverseOrder: true, + isIncludeCurrent: true, + pageLimit: 1, + }); + } async getMsgsBySeqAndCount(peer: Peer, seq: string, count: number, desc: boolean, z: boolean) { return await this.context.session.getMsgService().getMsgsBySeqAndCount(peer, seq, count, desc, z); } diff --git a/src/onebot/api/group.ts b/src/onebot/api/group.ts index bf112201..40f0380e 100644 --- a/src/onebot/api/group.ts +++ b/src/onebot/api/group.ts @@ -271,14 +271,11 @@ export class OneBotGroupApi { guildId: '', peerUid: groupCode, }; - const replyMsgList = (await this.core.apis.MsgApi.getMsgExBySeq(peer, msgSeq)).msgList; + const replyMsgList = (await this.core.apis.MsgApi.queryFirstMsgBySeq(peer, msgSeq)).msgList; if (replyMsgList.length < 1) { return; } - const replyMsg = replyMsgList - .filter(e => e.msgSeq == msgSeq) - .sort((a, b) => parseInt(a.msgTime) - parseInt(b.msgTime))[0]; - //console.log("表情回应消息长度检测", msgSeq, replyMsg.elements); + const replyMsg = replyMsgList[0]; if (!replyMsg) { this.core.context.logger.logError('解析表情回应消息失败: 未找到回应消息'); return undefined; diff --git a/src/webui/ui/NapCat.ts b/src/webui/ui/NapCat.ts index d6e0f729..7ba5ffa3 100644 --- a/src/webui/ui/NapCat.ts +++ b/src/webui/ui/NapCat.ts @@ -30,7 +30,7 @@ async function onSettingWindowCreated(view: Element) { SettingItem( 'Napcat', undefined, - SettingButton('V2.2.39', 'napcat-update-button', 'secondary'), + SettingButton('V2.2.40', 'napcat-update-button', 'secondary'), ), ]), SettingList([ diff --git a/static/assets/renderer.js b/static/assets/renderer.js index 707852cc..ef794de8 100644 --- a/static/assets/renderer.js +++ b/static/assets/renderer.js @@ -164,7 +164,7 @@ async function onSettingWindowCreated(view) { SettingItem( 'Napcat', void 0, - SettingButton("V2.2.39", "napcat-update-button", "secondary") + SettingButton("V2.2.40", "napcat-update-button", "secondary") ) ]), SettingList([