From a8b3a50d59025239b3f71151ef61b4e4001e6dc7 Mon Sep 17 00:00:00 2001 From: zhiyu1998 <542716863@qq.com> Date: Fri, 9 Aug 2024 13:26:17 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20chore:=20`#wiki`=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=20archive?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/query.js | 47 ----------------------------------------------- 1 file changed, 47 deletions(-) diff --git a/apps/query.js b/apps/query.js index 1aa081a..2028bd6 100644 --- a/apps/query.js +++ b/apps/query.js @@ -41,10 +41,6 @@ export class query extends plugin { { reg: "^#竹白(.*)", fnc: "zhubaiSearch", - }, - { - reg: "^#(wiki|百科)(.*)$", - fnc: "wiki", } ], }); @@ -229,49 +225,6 @@ export class query extends plugin { return true; } - // 百科 - async wiki(e) { - const key = e.msg.replace(/#|百科|wiki/g, "").trim(); - const url = `https://xiaoapi.cn/API/bk.php?m=json&type=sg&msg=${ encodeURI(key) }`; - const bdUrl = `https://xiaoapi.cn/API/bk.php?m=json&type=bd&msg=${ encodeURI(key) }`; - const bkRes = await Promise.all([ - axios - .get(bdUrl, { - headers: { - "User-Agent": COMMON_USER_AGENT, - }, - timeout: 10000, - }) - .then(resp => { - return resp.data; - }), - axios - .get(url, { - headers: { - "User-Agent": COMMON_USER_AGENT, - }, - timeout: 10000, - }) - .then(resp => { - return resp.data; - }), - ]).then(async res => { - return res.map(item => { - return { - message: ` - 解释:${ _.get(item, "msg") }\n - 详情:${ _.get(item, "more") }\n - `, - nickname: e.sender.card || e.user_id, - user_id: e.user_id, - }; - }); - // 小鸡解释:${ _.get(data2, 'content') } - }); - await e.reply(await Bot.makeForwardMsg(bkRes)); - return true; - } - // 删除标签 removeTag(title) { const titleRex = /<[^>]+>/g;