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

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.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,6 +30,7 @@ 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.2 网址加白处理
33
34
  - 0.3.1 错别字修改
34
35
  - 0.3.0 移除耗内存的截图部分,使用镜像站点网页
35
36
  - 0.2.0 尝试添加 MWN 库
@@ -52,7 +53,7 @@ function apply(ctx, config) {
52
53
  }
53
54
  return `请点击链接前往站点查看:
54
55
  原站点: ${encodeURI(
55
- res
56
+ res.replace(config.originalUrl, "https://oni.wiki/")
56
57
  )}
57
58
  镜像站: ${encodeURI(
58
59
  res.replace(config.originalUrl, config.mirrorUrl)
@@ -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.2",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [