@sjtdev/koishi-plugin-dota2tracker 1.1.5-beta.4 → 1.1.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.
Files changed (2) hide show
  1. package/lib/index.js +8 -4
  2. package/package.json +3 -4
package/lib/index.js CHANGED
@@ -1011,7 +1011,7 @@ var HEROES_CHINESE = {
1011
1011
  "68": ["远古冰魄", "冰魂"],
1012
1012
  "69": ["末日使者", "末日", "Doom"],
1013
1013
  "70": ["熊战士", "拍拍", "拍拍熊"],
1014
- "71": ["裂魂人", "白牛"],
1014
+ "71": ["裂魂人", "白牛", "sb"],
1015
1015
  "72": ["矮人直升机", "飞机"],
1016
1016
  "73": ["炼金术士", "炼金"],
1017
1017
  "74": ["祈求者", "卡尔"],
@@ -1480,7 +1480,7 @@ async function apply(ctx, config) {
1480
1480
  return heroes3.find((hero) => hero.names_cn.includes(input) || hero.shortName === input.toLowerCase() || hero.id == input);
1481
1481
  }
1482
1482
  __name(findingHero, "findingHero");
1483
- ctx.command("7.36 <input_data>", "查询7.36改动").option("refresh", "-f 重新获取数据").usage("可查询英雄改动并生成图片返回").example("7.36 小松许").action(async ({ session, options }, input_data) => {
1483
+ ctx.command("7.36 <input_data>", "查询7.36改动").option("refresh", "-r 重新获取数据").usage("可查询英雄改动并生成图片返回").example("7.36 小松许").action(async ({ session, options }, input_data) => {
1484
1484
  if (!("dt_7_36" in ctx.database.tables) || options.refresh) {
1485
1485
  session.send((!("dt_7_36" in ctx.database.tables) ? "初次使用," : "") + "正在获取数据……");
1486
1486
  await ctx.model.extend("dt_7_36", { id: "integer", data: "string" });
@@ -1522,11 +1522,15 @@ async function apply(ctx, config) {
1522
1522
  await page.close();
1523
1523
  }
1524
1524
  if (input_data) {
1525
- await session.send("正在查询,请耐心等待……");
1525
+ const hero = findingHero(input_data);
1526
+ if (!hero) {
1527
+ session.send("英雄参数输入有误,请检查后重试。");
1528
+ return;
1529
+ }
1530
+ session.send("正在查询,请耐心等待……");
1526
1531
  const page = await ctx.puppeteer.page();
1527
1532
  await page.setContent((await ctx.database.get("dt_7_36", [0]))[0].data);
1528
1533
  await page.waitForSelector("body > div:nth-of-type(2) > div:first-of-type > div:nth-of-type(2) > div:nth-of-type(3) > div:nth-of-type(5) > div:nth-of-type(2) > div:nth-of-type(1)");
1529
- const hero = findingHero(input_data);
1530
1534
  const placeholder = await page.$("div.placeholder");
1531
1535
  await page.waitForSelector("div.placeholder");
1532
1536
  const newHeroHTML = (await ctx.database.get("dt_7_36", [hero.id]))[0].data;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sjtdev/koishi-plugin-dota2tracker",
3
3
  "description": "",
4
- "version": "1.1.5-beta.4",
4
+ "version": "1.1.5",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [
@@ -11,8 +11,7 @@
11
11
  "template"
12
12
  ],
13
13
  "contributors": [
14
- "sjtdev <sh1j1n9ta0@foxmail.com>",
15
- "sjtdev"
14
+ "sjtdev <sh1j1n9ta0@foxmail.com>"
16
15
  ],
17
16
  "homepage": "https://github.com/sjtdev/koishi-plugin-dota2tracker",
18
17
  "repository": {
@@ -24,7 +23,7 @@
24
23
  "chatbot",
25
24
  "koishi",
26
25
  "plugin",
27
- "dota"
26
+ "dota2"
28
27
  ],
29
28
  "dependencies": {
30
29
  "axios": "^1.6.8",