🐞 fix: V1.5.1 修复miyoushe解析的部分问题

1. 修复部分图片、视频无法解析问题
2. 修复解析的内容出现Object问题
This commit is contained in:
zhiyu1998 2024-03-02 13:48:36 +08:00
parent 4d1b289597
commit 77bc362ebe
2 changed files with 16 additions and 15 deletions

View File

@ -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));
}
})
}

View File

@ -1,5 +1,5 @@
- {
version: 1.5.0,
version: 1.5.1,
data:
[
新增<span class="cmd">最右解析</span>功能,