koishi-plugin-ets2-tools-tmp 3.2.1 → 3.3.1

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.
@@ -1,4 +1,4 @@
1
- const BASE_APIS = ['https://evmapi.114512.xyz']
1
+ const BASE_APIS = ['https://evmapi.cxnnn.cn']
2
2
 
3
3
  async function requestWithFallback(http, path) {
4
4
  let lastError = null
@@ -1,4 +1,4 @@
1
- const BASE_API = 'https://evmapi.114512.xyz/proxy/truckersmp';
1
+ const BASE_API = 'https://evmapi.cxnnn.cn/proxy/truckersmp';
2
2
  // const BASE_API = 'https://api.truckersmp.com/v2';
3
3
  module.exports = {
4
4
  /**
@@ -1,4 +1,4 @@
1
- const BASE_API = 'https://evmapi.114512.xyz/proxy/ets2map';
1
+ const BASE_API = 'https://evmapi.cxnnn.cn/proxy/ets2map';
2
2
  // const BASE_API = 'https://tracker.ets2map.com';
3
3
  module.exports = {
4
4
  /**
@@ -1,4 +1,4 @@
1
- const BASE_API = 'https://evmapi.114512.xyz/proxy/trucky'
1
+ const BASE_API = 'https://evmapi.cxnnn.cn/proxy/trucky'
2
2
  // const BASE_API = 'https://api.codetabs.com/v1/proxy/?quest=https://api.truckyapp.com'
3
3
 
4
4
  module.exports = {
@@ -62,6 +62,16 @@ module.exports = async (ctx, session, serverType, tmpId, date) => {
62
62
  endTime = yesterday.endOf('day').format('YYYY-MM-DD HH:mm:ss');
63
63
  }
64
64
 
65
+ if (date === 'year') {
66
+ startTime = dayjs().subtract(1, 'year').startOf('year').startOf('day').format('YYYY-MM-DD HH:mm:ss');
67
+ endTime = dayjs().format('YYYY-MM-DD HH:mm:ss');
68
+ }
69
+
70
+ if (date === 'month') {
71
+ startTime = dayjs().subtract(1, 'month').startOf('month').startOf('day').format('YYYY-MM-DD HH:mm:ss');
72
+ endTime = dayjs().format('YYYY-MM-DD HH:mm:ss');
73
+ }
74
+
65
75
  if (date === 'today') {
66
76
  startTime = dayjs().startOf('day').format('YYYY-MM-DD HH:mm:ss');
67
77
  endTime = dayjs().endOf('day').format('YYYY-MM-DD HH:mm:ss');
@@ -165,7 +165,7 @@ module.exports = async (ctx, cfg, session, tmpId) => {
165
165
  const steamApiKey = cfg.steamApi?.key;
166
166
  if (steamApiKey) {
167
167
  const steamId = playerInfo.data.steamId;
168
- const url = `https://evmapi.114512.xyz/proxy/steam/IPlayerService/GetOwnedGames/v1?key=${steamApiKey}&steamid=${steamId}&appids_filter[0]=227300&appids_filter[1]=270880&include_played_free_games=1`;
168
+ const url = `https://evmapi.cxnnn.cn/proxy/steam/IPlayerService/GetOwnedGames/v1?key=${steamApiKey}&steamid=${steamId}&appids_filter[0]=227300&appids_filter[1]=270880&include_played_free_games=1`;
169
169
  const response = await ctx.http.get(url);
170
170
  if (response.response && response.response.game_count > 0) {
171
171
  for (const game of response.response.games) {
@@ -189,7 +189,7 @@ module.exports = async (ctx, cfg, session, tmpId) => {
189
189
  if (!steamApiKey) {
190
190
  return { ets2: null, ats: null };
191
191
  }
192
- const url = `https://api.114512.xyz/steam/IPlayerService/GetOwnedGames/v1?key=${steamApiKey}&steamid=${steamId}&appids_filter[0]=227300&appids_filter[1]=270880&include_played_free_games=1`;
192
+ const url = `https://evmapi.cxnnn.cn/proxy/steam/IPlayerService/GetOwnedGames/v1?key=${steamApiKey}&steamid=${steamId}&appids_filter[0]=227300&appids_filter[1]=270880&include_played_free_games=1`;
193
193
  const response = await ctx.http.get(url);
194
194
  const result = { ets2: null, ats: null };
195
195
 
package/lib/index.js CHANGED
@@ -338,6 +338,30 @@ function registerBaseCommands(ctx, cfg) {
338
338
  }
339
339
 
340
340
  if (cfg.commands?.tmpFootprint) {
341
+ ctx.command('近一年足迹 [tmpId:string]')
342
+ .usage("查询ETS服务器今日足迹")
343
+ .example("近一年足迹")
344
+ .example("近一年足迹 12345")
345
+ .action(async ({ session }, tmpId) => await commands.tmpFootprint(ctx, session, ServerType.ets, tmpId, 'year'));
346
+
347
+ ctx.command('近一年足迹p [tmpId:string]')
348
+ .usage("查询Promods服务器今日足迹")
349
+ .example("近一年足迹p")
350
+ .example("近一年足迹p 12345")
351
+ .action(async ({ session }, tmpId) => await commands.tmpFootprint(ctx, session, ServerType.promods, tmpId, 'year'));
352
+
353
+ ctx.command('近一个月足迹 [tmpId:string]')
354
+ .usage("查询ETS服务器今日足迹")
355
+ .example("近一个月足迹")
356
+ .example("近一个月足迹 12345")
357
+ .action(async ({ session }, tmpId) => await commands.tmpFootprint(ctx, session, ServerType.ets, tmpId, 'month'));
358
+
359
+ ctx.command('近一个月足迹p [tmpId:string]')
360
+ .usage("查询Promods服务器今日足迹")
361
+ .example("近一个月足迹p")
362
+ .example("近一个月足迹p 12345")
363
+ .action(async ({ session }, tmpId) => await commands.tmpFootprint(ctx, session, ServerType.promods, tmpId, 'month'));
364
+
341
365
  ctx.command('近七日足迹 [tmpId:string]')
342
366
  .usage("查询ETS服务器今日足迹")
343
367
  .example("近七日足迹")
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-ets2-tools-tmp",
3
3
  "description": "欧卡2 TruckersMP信息查询、车队平台查询及活动提醒",
4
- "version": "3.2.1",
4
+ "version": "3.3.1",
5
5
  "contributors": [
6
6
  "opwop <slhp1013@qq.com>",
7
7
  "bot_actions <168329908@qq.com>"