feat: 新增指令#r番剧

This commit is contained in:
zhiyu1998 2024-08-21 14:06:49 +08:00
parent 1eaa43c91b
commit 5da5196808

View File

@ -237,13 +237,26 @@ export class query extends plugin {
e.reply("暂无番剧信息"); e.reply("暂无番剧信息");
return; 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) { if (findRes == null) {
e.reply("未找到相关番剧"); e.reply("未找到相关番剧");
return; return;
} }
const { cover, shortLink, shortLink2 } = findRes[1]; let forwardMsg = [{
e.reply([segment.image(cover), `${findRes[0]}\n\n🪶 在线观看: ${ shortLink }\n🌸 在线观看: ${ shortLink2 }\n${DIVIDING_LINE.replace("{}", "收录信息")}\n当前管理员已经收录了: ${ Object.keys(animeList).length } 个番剧`]); 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; return true;
} }