koishi-plugin-node-async-bot-all 2.26.4 → 2.26.6

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
@@ -7,6 +7,9 @@ declare module 'koishi' {
7
7
  interface Events {
8
8
  "node-async/news"(): void;
9
9
  }
10
+ interface Context {
11
+ cron: (expression: string, callback: () => void) => void;
12
+ }
10
13
  }
11
14
  interface botDataTables {
12
15
  id: string;
@@ -30,6 +33,7 @@ interface CenterServerConfig {
30
33
  export interface Config {
31
34
  cxV3: Array<ConfigCxV3>;
32
35
  rwAPI: string;
36
+ htmlTimeout: number;
33
37
  timeout: number;
34
38
  baAPI: string[];
35
39
  slTest: CenterServerConfig[];
package/lib/index.js CHANGED
@@ -783,7 +783,7 @@ async function getQQInfo(ctx, session, qq) {
783
783
  height: 650,
784
784
  deviceScaleFactor: 2
785
785
  });
786
- await page.setContent(fullHtml, { waitUntil: "networkidle0" });
786
+ await page.setContent(fullHtml, { timeout: ctx.config.htmlTimeout, waitUntil: "networkidle0" });
787
787
  const { width, height } = await page.evaluate(() => ({
788
788
  width: document.body.scrollWidth,
789
789
  height: document.body.scrollHeight
@@ -847,7 +847,7 @@ async function getMsg(ctx, session, inversion) {
847
847
  height: 1,
848
848
  deviceScaleFactor: 2
849
849
  });
850
- await page.setContent(html, { waitUntil: "networkidle0" });
850
+ await page.setContent(html, { timeout: ctx.config.htmlTimeout, waitUntil: "networkidle0" });
851
851
  const { width, height } = await page.evaluate(() => ({
852
852
  width: document.body.scrollWidth + 50,
853
853
  height: document.body.scrollHeight
@@ -904,7 +904,7 @@ async function getNewsMsg(ctx, type) {
904
904
  height: 800,
905
905
  deviceScaleFactor: 2
906
906
  });
907
- await page.setContent(html[0], { waitUntil: "networkidle0" });
907
+ await page.setContent(html[0], { timeout: ctx.config.htmlTimeout, waitUntil: "networkidle0" });
908
908
  const { width, height } = await page.evaluate(() => ({
909
909
  width: document.body.scrollWidth,
910
910
  height: document.body.scrollHeight
@@ -940,7 +940,7 @@ async function getUse(ctx, session, qq, desc) {
940
940
  __name(getUse, "getUse");
941
941
 
942
942
  // package.json
943
- var version = "2.26.4";
943
+ var version = "2.26.6";
944
944
 
945
945
  // src/index.ts
946
946
  var inject = ["database", "installer", "puppeteer", "cron"];
@@ -948,7 +948,8 @@ var name = "node-async-bot-all";
948
948
  var usage = "这是一个私有插件。";
949
949
  var Config = import_koishi3.Schema.intersect([
950
950
  import_koishi3.Schema.object({
951
- timeout: import_koishi3.Schema.number().default(8e3).description("超时时间(毫秒)")
951
+ timeout: import_koishi3.Schema.number().default(8e3).description("超时时间(毫秒)"),
952
+ htmlTimeout: import_koishi3.Schema.number().default(3e4).description("HTML 超时时间(毫秒)")
952
953
  }).description("基础"),
953
954
  import_koishi3.Schema.object({
954
955
  cxV3: import_koishi3.Schema.array(
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-node-async-bot-all",
3
3
  "description": "NodeAsync Bot插件(自用)",
4
- "version": "2.26.4",
4
+ "version": "2.26.6",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "contributors": [
@@ -33,9 +33,7 @@
33
33
  "@koishijs/plugin-database-sqlite": "^4.6.0",
34
34
  "@koishijs/plugin-help": "^2.4.5",
35
35
  "@koishijs/plugin-market": "^2.11.8",
36
- "koishi": "^4.18.7",
37
- "koishi-plugin-cron": "^3.1.0",
38
- "koishi-plugin-puppeteer": "^3.9.0"
36
+ "koishi": "^4.18.7"
39
37
  },
40
38
  "dependencies": {
41
39
  "@bbob/html": "^4.3.1",