diff --git a/apps/query.js b/apps/query.js index e8459b5..ce59f1a 100644 --- a/apps/query.js +++ b/apps/query.js @@ -2,7 +2,7 @@ import axios from "axios"; import _ from "lodash"; import fetch from "node-fetch"; // 常量 -import { CAT_LIMIT, COMMON_USER_AGENT } from "../constants/constant.js"; +import { CAT_LIMIT, COMMON_USER_AGENT, MESSAGE_RECALL_TIME } from "../constants/constant.js"; import { LINUX_AI_PROMPT, LINUX_QUERY, @@ -63,6 +63,10 @@ export class query extends plugin { { reg: "^#R文档(.*)", fnc: "intelligentDoc", + }, + { + reg: '^#验车(.*?)', + fnc: 'yc' } ], }); @@ -394,6 +398,27 @@ export class query extends plugin { return; } + async yc(e) { + const tag = e.msg.replace(/#验车/g, ""); + + const reqUrl = `https://whatslink.info/api/v1/link?url=${tag}`; + const resp = await axios.get(reqUrl); + if (!resp.data) { + e.reply("没有找到相关磁力"); + return; + } + e.reply(`🧲 [R插件 x Mix] 联合为您验车:\n${ resp.data.name }`); + const screenshots = resp.data.screenshots.map(item => { + const screenshot = item.screenshot; + return { + message: segment.image(screenshot), + nickname: this.e.sender.card || this.e.user_id, + user_id: this.e.user_id, + } + }); + e.reply(Bot.makeForwardMsg(screenshots), false, { recallMsg: MESSAGE_RECALL_TIME }); + } + // 删除标签 removeTag(title) { const titleRex = /<[^>]+>/g;