From 5da519680846b0c548d3aa5b7cb8cb82346af71e Mon Sep 17 00:00:00 2001 From: zhiyu1998 <542716863@qq.com> Date: Wed, 21 Aug 2024 14:06:49 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20=E6=96=B0=E5=A2=9E=E6=8C=87?= =?UTF-8?q?=E4=BB=A4`#r=E7=95=AA=E5=89=A7`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/query.js | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/apps/query.js b/apps/query.js index e0842e8..e247969 100644 --- a/apps/query.js +++ b/apps/query.js @@ -237,13 +237,26 @@ export class query extends plugin { e.reply("暂无番剧信息"); return; } - const findRes = Object.entries(animeList).find(([key, value]) => key.includes(title)); + const findRes = Object.entries(animeList).filter(([key, value]) => key.includes(title)); if (findRes == null) { e.reply("未找到相关番剧"); return; } - const { cover, shortLink, shortLink2 } = findRes[1]; - e.reply([segment.image(cover), `《${findRes[0]}》\n\n🪶 在线观看: ${ shortLink }\n🌸 在线观看: ${ shortLink2 }\n${DIVIDING_LINE.replace("{}", "收录信息")}\n当前管理员已经收录了: ${ Object.keys(animeList).length } 个番剧`]); + let forwardMsg = [{ + message: { type: 'text', text: `当前管理员已经收录了: ${ Object.keys(animeList).length } 个番剧`}, + nickname: this.e.sender.card || this.e.user_id, + user_id: this.e.user_id, + }]; + for (let item of findRes) { + const { cover, shortLink, shortLink2 } = item[1]; + forwardMsg.push({ + message: [segment.image(cover), `《${ item[0] }》\n\n🪶 在线观看: ${ shortLink }\n🌸 在线观看: ${ shortLink2 }`], + nickname: this.e.sender.card || this.e.user_id, + user_id: this.e.user_id, + }); + } + + e.reply(await Bot.makeForwardMsg(forwardMsg)); return true; }