mirror of
https://github.com/Jerryplusy/rc-plugin.git
synced 2025-10-14 08:09:19 +00:00
✨ feat: 新增 #rso
搜索功能
- 在 config/version.yaml 中新增 rso 搜索功能,优化队列下载和 GPT 功能 - 增加哔哩哔哩下载分辨率设置功能,新增自定义识别功能 - 支持锅巴插件,方便查看和修改配置 - 更新 query.js 文件,增加必应搜索功能支持 - 优化常量配置,增加 BING_SEARCH 常量,支持新的搜索功能
This commit is contained in:
parent
e87ce119a5
commit
c4c8eaeb85
@ -4,6 +4,7 @@ import fetch from "node-fetch";
|
|||||||
// 常量
|
// 常量
|
||||||
import { CAT_LIMIT, COMMON_USER_AGENT } from "../constants/constant.js";
|
import { CAT_LIMIT, COMMON_USER_AGENT } from "../constants/constant.js";
|
||||||
import {
|
import {
|
||||||
|
BING_SEARCH,
|
||||||
LINUX_AI_PROMPT,
|
LINUX_AI_PROMPT,
|
||||||
LINUX_QUERY,
|
LINUX_QUERY,
|
||||||
RDOC_AI_PROMPT,
|
RDOC_AI_PROMPT,
|
||||||
@ -63,6 +64,10 @@ export class query extends plugin {
|
|||||||
{
|
{
|
||||||
reg: "^#R文档(.*)",
|
reg: "^#R文档(.*)",
|
||||||
fnc: "intelligentDoc",
|
fnc: "intelligentDoc",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ret: "^#(R|r)so(.*)",
|
||||||
|
fnc: "rso",
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
@ -394,6 +399,23 @@ export class query extends plugin {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async rso(e) {
|
||||||
|
const question = e.msg.replace("#Rso", "").replace("#rso", "").trim();
|
||||||
|
logger.info(question);
|
||||||
|
const resp = await fetch(BING_SEARCH.replace("{}", question), {
|
||||||
|
headers: {
|
||||||
|
"User-Agent": COMMON_USER_AGENT,
|
||||||
|
}
|
||||||
|
});
|
||||||
|
logger.info(await resp);
|
||||||
|
const respJson = (await resp.json()).data;
|
||||||
|
const constructSearchRes = textArrayToMakeForward(e, respJson.map(item =>
|
||||||
|
`标题:《${ item.title }》\n📝 简要:${ item.abstract }\n➡️链接:${ item.href }`
|
||||||
|
));
|
||||||
|
await e.reply(Bot.makeForwardMsg(constructSearchRes));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// 删除标签
|
// 删除标签
|
||||||
removeTag(title) {
|
removeTag(title) {
|
||||||
const titleRex = /<[^>]+>/g;
|
const titleRex = /<[^>]+>/g;
|
||||||
|
@ -2,10 +2,10 @@
|
|||||||
version: 1.9.0,
|
version: 1.9.0,
|
||||||
data:
|
data:
|
||||||
[
|
[
|
||||||
|
新增<span class="cmd">rso搜索</span>功能,
|
||||||
优化<span class="cmd">队列下载和GPT</span>功能,
|
优化<span class="cmd">队列下载和GPT</span>功能,
|
||||||
新增<span class="cmd">哔哩哔哩下载分辨率设置</span>功能,
|
新增<span class="cmd">哔哩哔哩下载分辨率设置</span>功能,
|
||||||
新增<span class="cmd">自定义识别</span>功能,
|
新增<span class="cmd">自定义识别</span>功能,
|
||||||
修正<span class="cmd">油管分辨率降低到720P</span>功能,
|
|
||||||
支持<span class="cmd">锅巴</span>插件,方便查看和修改配置,
|
支持<span class="cmd">锅巴</span>插件,方便查看和修改配置,
|
||||||
输入<span class="cmd">#R帮助</span>获取插件帮助,
|
输入<span class="cmd">#R帮助</span>获取插件帮助,
|
||||||
输入<span class="cmd">#R更新</span>更新插件,
|
输入<span class="cmd">#R更新</span>更新插件,
|
||||||
|
@ -2,7 +2,13 @@
|
|||||||
* linux 命令查询
|
* linux 命令查询
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
export const LINUX_QUERY = "https://api.pearktrue.cn/api/linux/?keyword={}"
|
export const LINUX_QUERY = "https://api.pearktrue.cn/api/linux/?keyword={}";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 必应搜索
|
||||||
|
* @type {string}
|
||||||
|
*/
|
||||||
|
export const BING_SEARCH = "https://api.pearktrue.cn/api/bingsearch/?search={}";
|
||||||
|
|
||||||
export const RDOC_LINK = "https://gitee.com/kyrzy0416/rconsole-plugin/raw/docs/posts/QA%E5%AE%98%E6%96%B9%E8%A7%A3%E7%AD%94.md";
|
export const RDOC_LINK = "https://gitee.com/kyrzy0416/rconsole-plugin/raw/docs/posts/QA%E5%AE%98%E6%96%B9%E8%A7%A3%E7%AD%94.md";
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user