diff --git a/apps/query.js b/apps/query.js
index e8459b5..1860a08 100644
--- a/apps/query.js
+++ b/apps/query.js
@@ -4,6 +4,7 @@ import fetch from "node-fetch";
// 常量
import { CAT_LIMIT, COMMON_USER_AGENT } from "../constants/constant.js";
import {
+ BING_SEARCH,
LINUX_AI_PROMPT,
LINUX_QUERY,
RDOC_AI_PROMPT,
@@ -63,6 +64,10 @@ export class query extends plugin {
{
reg: "^#R文档(.*)",
fnc: "intelligentDoc",
+ },
+ {
+ ret: "^#(R|r)so(.*)",
+ fnc: "rso",
}
],
});
@@ -394,6 +399,23 @@ export class query extends plugin {
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) {
const titleRex = /<[^>]+>/g;
diff --git a/config/version.yaml b/config/version.yaml
index 3f53ec7..f8e4610 100644
--- a/config/version.yaml
+++ b/config/version.yaml
@@ -2,10 +2,10 @@
version: 1.9.0,
data:
[
+ 新增rso搜索功能,
优化队列下载和GPT功能,
新增哔哩哔哩下载分辨率设置功能,
新增自定义识别功能,
- 修正油管分辨率降低到720P功能,
支持锅巴插件,方便查看和修改配置,
输入#R帮助获取插件帮助,
输入#R更新更新插件,
diff --git a/constants/query.js b/constants/query.js
index 377caef..bb46db7 100644
--- a/constants/query.js
+++ b/constants/query.js
@@ -2,7 +2,13 @@
* linux 命令查询
* @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";