koishi-plugin-ets2-tools-tmp 2.5.7 → 2.5.9
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/command/tmpFootprint.js +4 -16
- package/lib/command/tmpPosition.js +2 -2
- package/lib/index.js +8 -32
- package/package.json +1 -1
|
@@ -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 === '
|
|
71
|
-
startTime = dayjs().startOf('
|
|
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 === '
|
|
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('
|
|
279
|
+
ctx.command('近十日足迹 [tmpId:string]')
|
|
280
280
|
.usage("查询ETS服务器今日足迹")
|
|
281
|
-
.example("
|
|
282
|
-
.example("
|
|
283
|
-
.action(async ({ session }, tmpId) => await commands.tmpFootprint(ctx, session, ServerType.ets, tmpId, '
|
|
281
|
+
.example("近十日足迹")
|
|
282
|
+
.example("近十日足迹 12345")
|
|
283
|
+
.action(async ({ session }, tmpId) => await commands.tmpFootprint(ctx, session, ServerType.ets, tmpId, 'tenday'));
|
|
284
284
|
|
|
285
|
-
ctx.command('
|
|
285
|
+
ctx.command('近十日足迹p [tmpId:string]')
|
|
286
286
|
.usage("查询Promods服务器今日足迹")
|
|
287
|
-
.example("
|
|
288
|
-
.example("
|
|
289
|
-
.action(async ({ session }, tmpId) => await commands.tmpFootprint(ctx, session, ServerType.promods, tmpId, '
|
|
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
|
-
ctx.command('本月足迹 [tmpId:string]')
|
|
304
|
-
.usage("查询ETS服务器今日足迹")
|
|
305
|
-
.example("本月足迹")
|
|
306
|
-
.example("本月足迹 12345")
|
|
307
|
-
.action(async ({ session }, tmpId) => await commands.tmpFootprint(ctx, session, ServerType.ets, tmpId, 'thisMonth'));
|
|
308
|
-
|
|
309
|
-
ctx.command('本月足迹p [tmpId:string]')
|
|
310
|
-
.usage("查询Promods服务器今日足迹")
|
|
311
|
-
.example("本月足迹p")
|
|
312
|
-
.example("本月足迹p 12345")
|
|
313
|
-
.action(async ({ session }, tmpId) => await commands.tmpFootprint(ctx, session, ServerType.promods, tmpId, 'thisMonth'));
|
|
287
|
+
.example("近十日足迹p")
|
|
288
|
+
.example("近十日足迹p 12345")
|
|
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服务器今日足迹")
|