mirror of
https://github.com/Jerryplusy/rc-plugin.git
synced 2025-12-05 18:01:56 +00:00
✨ feat: 集成 Mix 的#验车
This commit is contained in:
parent
7aa487b13a
commit
3e8b1bcc72
@ -2,7 +2,7 @@ import axios from "axios";
|
|||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import fetch from "node-fetch";
|
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 {
|
import {
|
||||||
LINUX_AI_PROMPT,
|
LINUX_AI_PROMPT,
|
||||||
LINUX_QUERY,
|
LINUX_QUERY,
|
||||||
@ -63,6 +63,10 @@ export class query extends plugin {
|
|||||||
{
|
{
|
||||||
reg: "^#R文档(.*)",
|
reg: "^#R文档(.*)",
|
||||||
fnc: "intelligentDoc",
|
fnc: "intelligentDoc",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
reg: '^#验车(.*?)',
|
||||||
|
fnc: 'yc'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
@ -394,6 +398,27 @@ export class query extends plugin {
|
|||||||
return;
|
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) {
|
removeTag(title) {
|
||||||
const titleRex = /<[^>]+>/g;
|
const titleRex = /<[^>]+>/g;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user