From 77bc362ebe27298f19f31c6fc13e9e91d8f0fe1e Mon Sep 17 00:00:00 2001 From: zhiyu1998 <542716863@qq.com> Date: Sat, 2 Mar 2024 13:48:36 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix:=20V1.5.1=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8Dmiyoushe=E8=A7=A3=E6=9E=90=E7=9A=84=E9=83=A8=E5=88=86?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 修复部分图片、视频无法解析问题 2. 修复解析的内容出现Object问题 --- apps/tools.js | 29 +++++++++++++++-------------- config/version.yaml | 2 +- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/apps/tools.js b/apps/tools.js index 1722557..29b7689 100644 --- a/apps/tools.js +++ b/apps/tools.js @@ -1105,12 +1105,24 @@ export class tools extends plugin { } catch (e) { realContent = content; } - const normalMsg = `识别:米游社,${ subject }\n${ realContent }`; + const normalMsg = `识别:米游社,${ subject }\n${ realContent?.describe || "" }`; const replyMsg = cover ? [segment.image(cover), normalMsg] : normalMsg; e.reply(replyMsg); + // 图片 + if (images && images.length > 1) { + const replyImages = images.map(item => { + return { + message: segment.image(item), + nickname: this.e.sender.card || this.e.user_id, + user_id: this.e.user_id, + } + }); + e.reply(Bot.makeForwardMsg(replyImages)); + } // 视频 - if (structured_content) { - const sc = JSON.parse(structured_content); + const sc = JSON.parse(structured_content); + logger.info(sc.length) + if (sc?.[0]?.insert.vod.resolutions) { // 逐个遍历是否包含url for (let i = 0; i < sc.length; i++) { const resolutions = sc?.[i]?.insert.vod.resolutions; @@ -1124,17 +1136,6 @@ export class tools extends plugin { } } } - // 这个判断防止发送重复图片 - if (images && images.length > 1) { - const replyImages = images.map(item => { - return { - message: segment.image(item), - nickname: this.e.sender.card || this.e.user_id, - user_id: this.e.user_id, - } - }); - e.reply(Bot.makeForwardMsg(replyImages)); - } }) } diff --git a/config/version.yaml b/config/version.yaml index 6fb00b7..9560eaf 100644 --- a/config/version.yaml +++ b/config/version.yaml @@ -1,5 +1,5 @@ - { - version: 1.5.0, + version: 1.5.1, data: [ 新增最右解析功能,