koishi-plugin-ets2-tools-tmp 2.5.7 → 2.5.8

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.
@@ -67,20 +67,8 @@ module.exports = async (ctx, session, serverType, tmpId, date) => {
67
67
  endTime = dayjs().endOf('day').format('YYYY-MM-DD HH:mm:ss');
68
68
  }
69
69
 
70
- if (date === 'thisMonth') {
71
- startTime = dayjs().startOf('month').format('YYYY-MM-DD HH:mm:ss');
72
- endTime = dayjs().endOf('month').format('YYYY-MM-DD HH:mm:ss');
73
- }
74
-
75
- if (date === 'lastMonth') {
76
- const lastMonth = dayjs().subtract(1, 'month');
77
- startTime = lastMonth.startOf('month').format('YYYY-MM-DD HH:mm:ss');
78
- endTime = lastMonth.endOf('month').format('YYYY-MM-DD HH:mm:ss');
79
- }
80
-
81
- if (date === 'lastThreeMonths') {
82
- const threeMonthsAgo = dayjs().subtract(3, 'month');
83
- startTime = threeMonthsAgo.startOf('month').format('YYYY-MM-DD HH:mm:ss');
70
+ if (date === 'tenday') {
71
+ startTime = dayjs().subtract(10, 'day').startOf('day').format('YYYY-MM-DD HH:mm:ss');
84
72
  endTime = dayjs().endOf('day').format('YYYY-MM-DD HH:mm:ss');
85
73
  }
86
74
 
@@ -110,8 +98,8 @@ module.exports = async (ctx, session, serverType, tmpId, date) => {
110
98
  if (date === 'today') {
111
99
  return `今日暂无数据`;
112
100
  }
113
- if (date === 'thisMonth') {
114
- return `本月暂无数据`;
101
+ if (date === 'tenday') {
102
+ return `近十天暂无数据`;
115
103
  }
116
104
  if (date === 'lastMonth') {
117
105
  return `上月暂无数据`;
@@ -44,13 +44,13 @@ module.exports = async (ctx, cfg, session, tmpId) => {
44
44
  // 查询玩家信息
45
45
  let playerInfo = await truckersMpApi.player(ctx.http, tmpId)
46
46
  if (playerInfo.error) {
47
- return '查询玩家位置信息失败,请重试'
47
+ return '玩家位置信息查询失败,请重试'
48
48
  }
49
49
 
50
50
  // 查询线上信息
51
51
  let playerMapInfo = await truckyAppApi.online(ctx.http, tmpId)
52
52
  if (playerMapInfo.error) {
53
- return '查询玩家线上信息失败,请重试'
53
+ return '玩家线上信息查询失败,请重试'
54
54
  }
55
55
  if (!playerMapInfo.data.online) {
56
56
  return '玩家离线'
package/lib/index.js CHANGED
@@ -276,41 +276,17 @@ function registerBaseCommands(ctx, cfg) {
276
276
  }
277
277
 
278
278
  if (cfg.commands?.tmpFootprint) {
279
- ctx.command('上月足迹 [tmpId:string]')
280
- .usage("查询ETS服务器今日足迹")
281
- .example("上月足迹")
282
- .example("上月足迹 12345")
283
- .action(async ({ session }, tmpId) => await commands.tmpFootprint(ctx, session, ServerType.ets, tmpId, 'lastMonth'));
284
-
285
- ctx.command('上月足迹p [tmpId:string]')
286
- .usage("查询Promods服务器今日足迹")
287
- .example("本月上月足迹p足迹p")
288
- .example("上月足迹p 12345")
289
- .action(async ({ session }, tmpId) => await commands.tmpFootprint(ctx, session, ServerType.promods, tmpId, 'lastMonth'));
290
-
291
- ctx.command('近三个月足迹 [tmpId:string]')
292
- .usage("查询ETS服务器今日足迹")
293
- .example("近三个月足迹")
294
- .example("近三个月足迹 12345")
295
- .action(async ({ session }, tmpId) => await commands.tmpFootprint(ctx, session, ServerType.ets, tmpId, 'lastThreeMonths'));
296
-
297
- ctx.command('近三个月足迹p [tmpId:string]')
298
- .usage("查询Promods服务器今日足迹")
299
- .example("近三个月足迹p足迹p")
300
- .example("近三个月足迹p 12345")
301
- .action(async ({ session }, tmpId) => await commands.tmpFootprint(ctx, session, ServerType.promods, tmpId, 'lastThreeMonths'));
302
-
303
279
  ctx.command('本月足迹 [tmpId:string]')
304
280
  .usage("查询ETS服务器今日足迹")
305
281
  .example("本月足迹")
306
282
  .example("本月足迹 12345")
307
- .action(async ({ session }, tmpId) => await commands.tmpFootprint(ctx, session, ServerType.ets, tmpId, 'thisMonth'));
283
+ .action(async ({ session }, tmpId) => await commands.tmpFootprint(ctx, session, ServerType.ets, tmpId, 'tenday'));
308
284
 
309
285
  ctx.command('本月足迹p [tmpId:string]')
310
286
  .usage("查询Promods服务器今日足迹")
311
287
  .example("本月足迹p")
312
288
  .example("本月足迹p 12345")
313
- .action(async ({ session }, tmpId) => await commands.tmpFootprint(ctx, session, ServerType.promods, tmpId, 'thisMonth'));
289
+ .action(async ({ session }, tmpId) => await commands.tmpFootprint(ctx, session, ServerType.promods, tmpId, 'tenday'));
314
290
 
315
291
  ctx.command('昨日足迹 [tmpId:string]')
316
292
  .usage("查询ETS服务器今日足迹")
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": "2.5.7",
4
+ "version": "2.5.8",
5
5
  "contributors": [
6
6
  "opwop <slhp1013@qq.com>",
7
7
  "bot_actions <168329908@qq.com>"