diff --git a/apps/query.js b/apps/query.js index 16296d2..c609f20 100644 --- a/apps/query.js +++ b/apps/query.js @@ -47,10 +47,6 @@ export class query extends plugin { reg: "^#竹白(.*)", fnc: "zhubaiSearch", }, - { - reg: "^#(r|R)番剧(.*)", - fnc: "myAnimeList", - }, { reg: "^#(linux|Linux)(.*)", fnc: "linuxQuery" @@ -244,36 +240,6 @@ export class query extends plugin { return true; } - async myAnimeList(e) { - const title = e.msg.replace(/^#([rR])番剧/, "").trim(); - const animeList = await redisExistAndGetKey(REDIS_YUNZAI_ANIMELIST) - if (animeList == null) { - e.reply("暂无番剧信息"); - return; - } - const findRes = Object.entries(animeList).filter(([key, value]) => key.includes(title)); - if (findRes == null) { - e.reply("未找到相关番剧"); - return; - } - 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; - } - async linuxQuery(e) { const order = e.msg.replace(/^#([lL])inux/, "").trim(); // 查询 Redis 中是否存在这个命令如果存在直接返回没有的话就发起网络请求 diff --git a/apps/tools.js b/apps/tools.js index 1735c5e..5cf9c40 100644 --- a/apps/tools.js +++ b/apps/tools.js @@ -670,37 +670,12 @@ export class tools extends plugin { segment.image(resp.result.cover), `${ this.identifyPrefix }识别:哔哩哔哩番剧,${ result.title }\n🎯 评分: ${ result?.rating?.score ?? '-' } / ${ result?.rating?.count ?? '-' }\n📺 ${ result.new_ep.desc }, ${ result.seasons[0].new_ep.index_show }\n`, `${ formatBiliInfo(dataProcessMap) }`, - `\n\n🪶 在线观看: ${ shortLink }`, - `\n🌸 在线观看: ${ shortLink2 }` + `\n\n🪶 在线观看: ${ await urlTransformShortLink(ANIME_SERIES_SEARCH_LINK + title) }`, + `\n🌸 在线观看: ${ await urlTransformShortLink(ANIME_SERIES_SEARCH_LINK2 + title) }` ], true); return ep; } - /** - * 短链接缓存 - * @param title - * @returns {Promise<{shortLink2: string, shortLink: string}|*>} - */ - async biliAnimeCacheDetect(title, cover) { - const animeList = await redisExistAndGetKey(REDIS_YUNZAI_ANIMELIST) - if (animeList && animeList?.[title] !== undefined) { - return animeList?.[title]; - } - const shortLink = await urlTransformShortLink(ANIME_SERIES_SEARCH_LINK + title); - const shortLink2 = await urlTransformShortLink(ANIME_SERIES_SEARCH_LINK2 + title); - await redisExistAndInsertObject(REDIS_YUNZAI_ANIMELIST, { - [title]: { - cover, - shortLink, - shortLink2 - } - }); - return { - shortLink, - shortLink2 - } - } - /** * 哔哩哔哩下载策略 * @param e 事件