@sjtdev/koishi-plugin-dota2tracker 1.1.5-beta.1 → 1.1.5-beta.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.js +4 -3
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -1477,8 +1477,9 @@ async function apply(ctx, config) {
|
|
|
1477
1477
|
__name(findingHero, "findingHero");
|
|
1478
1478
|
ctx.command("7.36 <input_data>", "查询7.36改动").usage("可查询英雄改动并生成图片返回").example("7.36 小松许").action(async ({ session }, input_data) => {
|
|
1479
1479
|
if (input_data) {
|
|
1480
|
+
await session.send("正在查询,请耐心等待……");
|
|
1480
1481
|
const page = await ctx.puppeteer.page();
|
|
1481
|
-
await page.goto("https://www.dota2.com/patches/7.36");
|
|
1482
|
+
await page.goto("https://www.dota2.com.cn/patches/7.36");
|
|
1482
1483
|
await page.waitForSelector("body > div:nth-of-type(3) > div:first-of-type > div:nth-of-type(2) > div:nth-of-type(2) > div:nth-of-type(5) > div:nth-of-type(2) > div:nth-of-type(1)");
|
|
1483
1484
|
const hero = findingHero(input_data);
|
|
1484
1485
|
await page.evaluate((hero2) => {
|
|
@@ -1491,7 +1492,7 @@ async function apply(ctx, config) {
|
|
|
1491
1492
|
}
|
|
1492
1493
|
return null;
|
|
1493
1494
|
}, hero);
|
|
1494
|
-
const testE = await page.$("body > div:nth-of-type(
|
|
1495
|
+
const testE = await page.$("body > div:nth-of-type(3) > div:first-of-type > div:nth-of-type(2) > div:nth-of-type(2) > div:nth-of-type(5) > div:nth-of-type(2) > div.selector");
|
|
1495
1496
|
const res = await testE.screenshot();
|
|
1496
1497
|
const base64String = Buffer.from(res).toString("base64");
|
|
1497
1498
|
const imgTag = `<img src="data:image/png;base64,${base64String}" alt="Image" />`;
|
|
@@ -1499,7 +1500,7 @@ async function apply(ctx, config) {
|
|
|
1499
1500
|
import_fs2.default.writeFileSync("./node_modules/@sjtdev/koishi-plugin-dota2tracker/temp.png", res);
|
|
1500
1501
|
session.send(imgTag);
|
|
1501
1502
|
} else
|
|
1502
|
-
session.send("https://www.dota2.com/patches/7.36");
|
|
1503
|
+
session.send("https://www.dota2.com.cn/patches/7.36");
|
|
1503
1504
|
});
|
|
1504
1505
|
ctx.command("test <input_data>").action(async ({ session }, input_data) => {
|
|
1505
1506
|
});
|