koishi-plugin-oni-wiki-qq 0.2.2 → 0.2.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,12 +1,13 @@
1
1
  import { Context, Schema } from "koishi";
2
2
  export declare const name = "oni-wiki-qq";
3
3
  export declare const inject: string[];
4
- export declare const usage = "\n - 0.2.2 \u5C1D\u8BD5\u79FB\u9664\u9876\u90E8\u5BFC\u822A\n - 0.2.1 \u4EA4\u6362\u56FE\u7247\u548C\u6D88\u606F\u4F4D\u7F6E\u4EE5\u4F7Fqq\u53D1\u9001\u65F6\u5728\u540C\u4E00\u6D88\u606F\u907F\u514D\u5237\u5C4F\n - 0.2.0 \u5C1D\u8BD5\u6DFB\u52A0 MWN \u5E93\n - 0.1.0 \u6DFB\u52A0\u767B\u5F55\u548C\u70B9\u51FBcookies\u6309\u94AE,\u5220\u9664\u6CA1\u6CD5\u5224\u65AD\u7B54\u6848\u7684\u4EE3\u7801\n";
4
+ export declare const usage = "\n - 0.2.3 \u641E\u9519\u4E86,\u91CD\u6765\n - 0.2.2 \u5C1D\u8BD5\u79FB\u9664\u9876\u90E8\u5BFC\u822A\n - 0.2.1 \u4EA4\u6362\u56FE\u7247\u548C\u6D88\u606F\u4F4D\u7F6E\u4EE5\u4F7Fqq\u53D1\u9001\u65F6\u5728\u540C\u4E00\u6D88\u606F\u907F\u514D\u5237\u5C4F\n - 0.2.0 \u5C1D\u8BD5\u6DFB\u52A0 MWN \u5E93\n";
5
5
  export interface Config {
6
6
  api: string;
7
7
  imgPath: string;
8
8
  urlPath: string;
9
9
  navSelector: string;
10
+ navSelector2: string;
10
11
  contentSelector: string;
11
12
  loginUrl: string;
12
13
  userNameSelector: string;
package/lib/index.js CHANGED
@@ -86,16 +86,17 @@ __name(getWiki, "getWiki");
86
86
  var name = "oni-wiki-qq";
87
87
  var inject = ["puppeteer"];
88
88
  var usage = `
89
+ - 0.2.3 搞错了,重来
89
90
  - 0.2.2 尝试移除顶部导航
90
91
  - 0.2.1 交换图片和消息位置以使qq发送时在同一消息避免刷屏
91
92
  - 0.2.0 尝试添加 MWN 库
92
- - 0.1.0 添加登录和点击cookies按钮,删除没法判断答案的代码
93
93
  `;
94
94
  var Config = import_koishi.Schema.object({
95
95
  api: import_koishi.Schema.string().default("https://oxygennotincluded.wiki.gg/zh/api.php").description("api地址"),
96
96
  imgPath: import_koishi.Schema.string().default(import_node_os.default.homedir() + "/wikiImg/").description("图片保存路径"),
97
97
  urlPath: import_koishi.Schema.string().description("图片公网访问路径"),
98
98
  navSelector: import_koishi.Schema.string().description("导航框类名").default(".navbox"),
99
+ navSelector2: import_koishi.Schema.string().description("导航框类名").default("#wikigg-header"),
99
100
  contentSelector: import_koishi.Schema.string().description("内容区选择器").default("#mw-content-text"),
100
101
  loginUrl: import_koishi.Schema.string().description("登录页面地址").default(
101
102
  "https://oxygennotincluded.wiki.gg/zh/index.php?title=Special:%E7%94%A8%E6%88%B7%E7%99%BB%E5%BD%95&returnto=%E9%A6%96%E9%A1%B5"
@@ -154,7 +155,7 @@ function apply(ctx, config) {
154
155
  });
155
156
  try {
156
157
  await page.$eval(config.navSelector, (el) => el.remove());
157
- await page.$eval("#mw-head", (el) => el.remove());
158
+ await page.$eval(config.navSelector2, (el) => el.remove());
158
159
  } catch (error) {
159
160
  }
160
161
  const selector = await page.$(config.contentSelector);
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.2.2",
4
+ "version": "0.2.3",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [