koishi-plugin-tmp-bot 1.21.5 → 1.21.7
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/api/truckyAppApi.js +4 -3
- package/lib/command/tmpDlcMap.js +1 -1
- package/lib/command/tmpFootprint.js +1 -1
- package/lib/command/tmpMileageRanking.js +1 -1
- package/lib/command/tmpPosition.js +1 -1
- package/lib/command/tmpServer/tmpServerImg.js +1 -1
- package/lib/command/tmpTraffic/tmpTrafficMap.js +1 -1
- package/package.json +1 -1
package/lib/api/truckyAppApi.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
const BASE_API = 'https://api.
|
|
1
|
+
const BASE_API = 'https://api.truckyapp.com';
|
|
2
|
+
const HEADERS = { headers: { 'User-Agent': 'koishi-plugin-tmp-bot' } };
|
|
2
3
|
module.exports = {
|
|
3
4
|
/**
|
|
4
5
|
* 查询线上信息
|
|
@@ -6,7 +7,7 @@ module.exports = {
|
|
|
6
7
|
async online(http, tmpId) {
|
|
7
8
|
let result = null;
|
|
8
9
|
try {
|
|
9
|
-
result = await http.get(`${BASE_API}/v3/map/online?playerID=${tmpId}
|
|
10
|
+
result = await http.get(`${BASE_API}/v3/map/online?playerID=${tmpId}`, HEADERS);
|
|
10
11
|
}
|
|
11
12
|
catch {
|
|
12
13
|
return {
|
|
@@ -28,7 +29,7 @@ module.exports = {
|
|
|
28
29
|
async trafficTop(http, serverName) {
|
|
29
30
|
let result = null;
|
|
30
31
|
try {
|
|
31
|
-
result = await http.get(`${BASE_API}/v2/traffic/top?game=ets2&server=${serverName}
|
|
32
|
+
result = await http.get(`${BASE_API}/v2/traffic/top?game=ets2&server=${serverName}`, HEADERS);
|
|
32
33
|
}
|
|
33
34
|
catch {
|
|
34
35
|
return {
|
package/lib/command/tmpDlcMap.js
CHANGED
|
@@ -11,7 +11,7 @@ module.exports = async (ctx, session) => {
|
|
|
11
11
|
let page;
|
|
12
12
|
try {
|
|
13
13
|
page = await ctx.puppeteer.page();
|
|
14
|
-
await page.setViewport({ width: 1000, height: 1000, deviceScaleFactor:
|
|
14
|
+
await page.setViewport({ width: 1000, height: 1000, deviceScaleFactor: 1.5 });
|
|
15
15
|
await page.goto(`file:///${resolve(__dirname, '../resource/dlc.html')}`);
|
|
16
16
|
await page.evaluate(`setData(${JSON.stringify(dlcData.data)})`);
|
|
17
17
|
await page.waitForNetworkIdle();
|
|
@@ -60,7 +60,7 @@ module.exports = async (ctx, session, serverType, tmpId) => {
|
|
|
60
60
|
let page;
|
|
61
61
|
try {
|
|
62
62
|
page = await ctx.puppeteer.page();
|
|
63
|
-
await page.setViewport({ width: 1000, height: 1000, deviceScaleFactor:
|
|
63
|
+
await page.setViewport({ width: 1000, height: 1000, deviceScaleFactor: 1.5 });
|
|
64
64
|
await page.goto(`file:///${resolve(__dirname, '../resource/footprint.html')}`);
|
|
65
65
|
await page.evaluate(`init(${JSON.stringify(data)})`);
|
|
66
66
|
await common.sleep(100);
|
|
@@ -33,7 +33,7 @@ module.exports = async (ctx, session, rankingType) => {
|
|
|
33
33
|
let page;
|
|
34
34
|
try {
|
|
35
35
|
page = await ctx.puppeteer.page();
|
|
36
|
-
await page.setViewport({ width: 1000, height: 1000, deviceScaleFactor:
|
|
36
|
+
await page.setViewport({ width: 1000, height: 1000, deviceScaleFactor: 1.5 });
|
|
37
37
|
await page.goto(`file:///${resolve(__dirname, '../resource/mileage-leaderboard.html')}`);
|
|
38
38
|
await page.evaluate(`setData(${JSON.stringify(data)})`);
|
|
39
39
|
await page.waitForNetworkIdle();
|
|
@@ -70,7 +70,7 @@ module.exports = async (ctx, cfg, session, tmpId) => {
|
|
|
70
70
|
let page;
|
|
71
71
|
try {
|
|
72
72
|
page = await ctx.puppeteer.page();
|
|
73
|
-
await page.setViewport({ width: 1000, height: 1000, deviceScaleFactor:
|
|
73
|
+
await page.setViewport({ width: 1000, height: 1000, deviceScaleFactor: 1.5 });
|
|
74
74
|
await page.goto(`file:///${resolve(__dirname, '../resource/position.html')}`);
|
|
75
75
|
await page.evaluate(`setData(${JSON.stringify(data)})`);
|
|
76
76
|
await common.sleep(100);
|
|
@@ -14,7 +14,7 @@ module.exports = async (ctx) => {
|
|
|
14
14
|
let page;
|
|
15
15
|
try {
|
|
16
16
|
page = await ctx.puppeteer.page();
|
|
17
|
-
await page.setViewport({ width: 380, height: 1000, deviceScaleFactor:
|
|
17
|
+
await page.setViewport({ width: 380, height: 1000, deviceScaleFactor: 1.5 });
|
|
18
18
|
await page.goto(`file:///${resolve(__dirname, '../../resource/server-list.html')}`);
|
|
19
19
|
await page.evaluate(`setData(${JSON.stringify(serverData)})`);
|
|
20
20
|
await common.sleep(100);
|
|
@@ -98,7 +98,7 @@ module.exports = async (ctx, cfg, serverName) => {
|
|
|
98
98
|
let page;
|
|
99
99
|
try {
|
|
100
100
|
page = await ctx.puppeteer.page();
|
|
101
|
-
await page.setViewport({ width: 1000, height: 1000, deviceScaleFactor:
|
|
101
|
+
await page.setViewport({ width: 1000, height: 1000, deviceScaleFactor: 1.5 });
|
|
102
102
|
await page.goto(`file:///${resolve(__dirname, '../../resource/traffic.html')}`);
|
|
103
103
|
await page.evaluate(`setData(${JSON.stringify(data)})`);
|
|
104
104
|
await common.sleep(100);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "koishi-plugin-tmp-bot",
|
|
3
3
|
"description": "欧洲卡车模拟2 TMP查询插件,不会部署的可以直接使用此机器人->QQ:3523283907",
|
|
4
|
-
"version": "1.21.
|
|
4
|
+
"version": "1.21.7",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
7
7
|
"homepage": "https://github.com/79887143/koishi-plugin-tmp-bot",
|