From 883697df60d5d6666d0d2420274685c7d88ad8e1 Mon Sep 17 00:00:00 2001 From: zhiyu1998 <542716863@qq.com> Date: Wed, 21 Aug 2024 13:39:25 +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`#=E6=B1=87=E9=9B=86=E7=95=AA=E5=89=A7`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/query.js | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/apps/query.js b/apps/query.js index 812fce6..b1de241 100644 --- a/apps/query.js +++ b/apps/query.js @@ -5,9 +5,10 @@ import puppeteer from "../../../lib/puppeteer/puppeteer.js"; // http库 import axios from "axios"; // 常量 -import { CAT_LIMIT, COMMON_USER_AGENT } from "../constants/constant.js"; +import { CAT_LIMIT, COMMON_USER_AGENT, REDIS_YUNZAI_ANIMELIST } from "../constants/constant.js"; // 配置文件 import config from "../model/config.js"; +import { redisExistAndGetKey } from "../utils/redis-util.js"; export class query extends plugin { @@ -41,6 +42,10 @@ export class query extends plugin { { reg: "^#竹白(.*)", fnc: "zhubaiSearch", + }, + { + reg: "^#汇集番剧$", + fnc: "myAnimeList", } ], }); @@ -225,6 +230,24 @@ export class query extends plugin { return true; } + async myAnimeList(e) { + const animeList = await redisExistAndGetKey(REDIS_YUNZAI_ANIMELIST) + if (animeList == null) { + e.reply("暂无番剧信息"); + return; + } + let forwardMsg = []; + for (let [key, value] of Object.entries(animeList)) { + forwardMsg.push({ + message: { type: 'text', text: `《${key}》\n🪶 在线观看:${value.shortLink}\n🌸 在线观看:${value.shortLink2}` }, + nickname: this.e.sender.card || this.e.user_id, + user_id: this.e.user_id, + }) + } + e.reply(await Bot.makeForwardMsg(forwardMsg)); + return true; + } + // 删除标签 removeTag(title) { const titleRex = /<[^>]+>/g;