koishi-plugin-oni-wiki-qq 0.3.1 → 0.3.3

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 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.3.1 \u9519\u522B\u5B57\u4FEE\u6539\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.3.3 \u6240\u6709\u7F51\u5740\u5904\u7406\n - 0.3.2 \u7F51\u5740\u52A0\u767D\u5904\u7406\n - 0.3.1 \u9519\u522B\u5B57\u4FEE\u6539\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 interface Config {
5
5
  api: string;
6
6
  originalUrl: string;
package/lib/index.js CHANGED
@@ -30,15 +30,17 @@ var import_koishi = require("koishi");
30
30
  var import_mwn = require("mwn");
31
31
  var name = "oni-wiki-qq";
32
32
  var usage = `
33
+ - 0.3.3 所有网址处理
34
+ - 0.3.2 网址加白处理
33
35
  - 0.3.1 错别字修改
34
36
  - 0.3.0 移除耗内存的截图部分,使用镜像站点网页
35
37
  - 0.2.0 尝试添加 MWN 库
36
38
  `;
37
39
  var Config = import_koishi.Schema.object({
38
40
  api: import_koishi.Schema.string().default("https://oxygennotincluded.wiki.gg/zh/api.php").description("api地址"),
39
- originalUrl: import_koishi.Schema.string().default("https://oxygennotincluded.wiki.gg/zh/").description("原站点网址"),
40
- mirrorUrl: import_koishi.Schema.string().default("https://wiki.biligame.com/oni/").description("镜像站点网址"),
41
- docUrl: import_koishi.Schema.string().default("https://www.yuque.com/u25332524/ftq4u7").description("大叔的文档地址"),
41
+ originalUrl: import_koishi.Schema.string().default("https://oxygennotincluded.wiki.gg/zh/wiki/").description("原站点网址"),
42
+ mirrorUrl: import_koishi.Schema.string().default("https://klei.vip/oni/usiz6d/").description("镜像站点网址"),
43
+ docUrl: import_koishi.Schema.string().default("klei.vip/oni/926f8b").description("大叔的文档地址"),
42
44
  userName: import_koishi.Schema.string().description("机器人用户名"),
43
45
  password: import_koishi.Schema.string().description("机器人密码")
44
46
  });
@@ -51,12 +53,11 @@ function apply(ctx, config) {
51
53
  return `在Wiki里没找到或API查询超时,如有需要,请按照游戏内名称重新发起查询....`;
52
54
  }
53
55
  return `请点击链接前往站点查看:
54
- 原站点: ${encodeURI(
55
- res
56
+ 原站点: ${res.replace(
57
+ config.originalUrl,
58
+ "https://oni.wiki/"
56
59
  )}
57
- 镜像站: ${encodeURI(
58
- res.replace(config.originalUrl, config.mirrorUrl)
59
- )}`;
60
+ 镜像站: ${res.replace(config.originalUrl, config.mirrorUrl)}`;
60
61
  });
61
62
  async function getWiki(itemName) {
62
63
  const bot = await import_mwn.Mwn.init({
@@ -82,7 +83,9 @@ function apply(ctx, config) {
82
83
  } else {
83
84
  return "";
84
85
  }
85
- }).catch(async (err) => console.log(err));
86
+ }).catch(async (err) => console.log(err)).finally(async () => {
87
+ bot.logout();
88
+ });
86
89
  }
87
90
  __name(getWiki, "getWiki");
88
91
  ctx.command("doc", "大叔的文档链接").alias("/大叔文档").action(async () => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-oni-wiki-qq",
3
3
  "description": "缺氧wiki查询,自用",
4
- "version": "0.3.1",
4
+ "version": "0.3.3",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [