koishi-plugin-oni-wiki-qq 0.4.4 → 0.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.d.ts +1 -1
- package/lib/index.js +8 -9
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Context, Schema } from "koishi";
|
|
2
2
|
export declare const name = "oni-wiki-qq";
|
|
3
|
-
export declare const usage = "\n - 0.4.4 \u52A0\u5165\u7528\u6237\u9875\u9762\n - 0.4.3 \u6536\u96C6\u641C\u7D22\u7684\u8BCD\u6C47\u9891\u7387\n - 0.4.2 \u4FEE\u6539/ \u7684\u4F7F\u7528\u65B9\u5F0F,\u6539\u4E3A >\n - 0.4.1 \u589E\u52A0/\u7684\u5904\u7406\n - 0.4.0 \u79FB\u9664MWN.\u5C06\u67E5\u8BE2\u5904\u7406\u6539\u81F3\u67E5\u8BE2\u6570\u636E\u5E93\n - 0.3.0 \u79FB\u9664\u8017\u5185\u5B58\u7684\u622A\u56FE\u90E8\u5206,\u4F7F\u7528\u955C\u50CF\u7AD9\u70B9\u7F51\u9875\n - 0.2.0 \u5C1D\u8BD5\u6DFB\u52A0 MWN \u5E93\n";
|
|
3
|
+
export declare const usage = "\n - 0.4.5 \u68C0\u6D4B\u6559\u7A0B\u9875\u9762\n - 0.4.4 \u52A0\u5165\u7528\u6237\u9875\u9762\n - 0.4.3 \u6536\u96C6\u641C\u7D22\u7684\u8BCD\u6C47\u9891\u7387\n - 0.4.2 \u4FEE\u6539/ \u7684\u4F7F\u7528\u65B9\u5F0F,\u6539\u4E3A >\n - 0.4.1 \u589E\u52A0/\u7684\u5904\u7406\n - 0.4.0 \u79FB\u9664MWN.\u5C06\u67E5\u8BE2\u5904\u7406\u6539\u81F3\u67E5\u8BE2\u6570\u636E\u5E93\n - 0.3.0 \u79FB\u9664\u8017\u5185\u5B58\u7684\u622A\u56FE\u90E8\u5206,\u4F7F\u7528\u955C\u50CF\u7AD9\u70B9\u7F51\u9875\n - 0.2.0 \u5C1D\u8BD5\u6DFB\u52A0 MWN \u5E93\n";
|
|
4
4
|
export declare const inject: string[];
|
|
5
5
|
declare module "koishi" {
|
|
6
6
|
interface Tables {
|
package/lib/index.js
CHANGED
|
@@ -30,6 +30,7 @@ module.exports = __toCommonJS(src_exports);
|
|
|
30
30
|
var import_koishi = require("koishi");
|
|
31
31
|
var name = "oni-wiki-qq";
|
|
32
32
|
var usage = `
|
|
33
|
+
- 0.4.5 检测教程页面
|
|
33
34
|
- 0.4.4 加入用户页面
|
|
34
35
|
- 0.4.3 收集搜索的词汇频率
|
|
35
36
|
- 0.4.2 修改/ 的使用方式,改为 >
|
|
@@ -61,6 +62,13 @@ function apply(ctx, config) {
|
|
|
61
62
|
}
|
|
62
63
|
);
|
|
63
64
|
ctx.command("x <itemName>", "查询缺氧中文wiki").alias("/查wiki").action(async ({ session }, itemName = "电解器") => {
|
|
65
|
+
if (/教程/.test(itemName)) {
|
|
66
|
+
return `请点击链接前往站点查看:
|
|
67
|
+
原站点: http://oni.wiki/${encodeURI(
|
|
68
|
+
`教程`
|
|
69
|
+
)}
|
|
70
|
+
镜像站: https://klei.vip/oni/usiz6d/${encodeURI(`教程`)}`;
|
|
71
|
+
}
|
|
64
72
|
await ctx.database.create("searchpages", {
|
|
65
73
|
title: itemName,
|
|
66
74
|
time: import_koishi.Time.template("yyyy-MM-dd hh:mm:ss", /* @__PURE__ */ new Date())
|
|
@@ -85,15 +93,6 @@ function apply(ctx, config) {
|
|
|
85
93
|
Cookie: `SESSDATA=${config.SESSDATA}`
|
|
86
94
|
};
|
|
87
95
|
const url = `https://wiki.biligame.com/oni/api.php?action=query&list=allpages&apnamespace=0&aplimit=5000&format=json`;
|
|
88
|
-
const user = `https://wiki.biligame.com/oni/api.php?action=query&list=allpages&apnamespace=2&aplimit=5000&format=json`;
|
|
89
|
-
await ctx.http.get(user, { headers }).then((res) => {
|
|
90
|
-
res["query"]["allpages"].forEach(async (element) => {
|
|
91
|
-
console.log(element.title);
|
|
92
|
-
await ctx.database.upsert("wikipages", () => [
|
|
93
|
-
{ id: element.pageid, title: element.title }
|
|
94
|
-
]);
|
|
95
|
-
});
|
|
96
|
-
});
|
|
97
96
|
return await ctx.http.get(url, {
|
|
98
97
|
headers
|
|
99
98
|
}).then((res) => {
|