koishi-plugin-tmp-bot 1.19.0 → 1.19.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.
@@ -1,4 +1,5 @@
1
1
  const { segment } = require('koishi');
2
+ const dayjs = require('dayjs');
2
3
  const { resolve } = require('path');
3
4
  const common = require('../util/common');
4
5
  const { ServerAliasToId, PromodsIds } = require('../util/constant');
@@ -28,7 +29,9 @@ module.exports = async (ctx, session, serverName) => {
28
29
  return '查询玩家信息失败,请重试';
29
30
  }
30
31
  // 查询当日历史位置数据
31
- let mapPlayerHistory = await evmOpenApi.mapPlayerHistory(ctx.http, tmpId, serverId, '2026-01-22 00:00:00', '2026-01-22 23:00:00');
32
+ const startTime = dayjs().startOf('day').format('YYYY-MM-DD HH:mm:ss');
33
+ const endTime = dayjs().endOf('day').format('YYYY-MM-DD HH:mm:ss');
34
+ let mapPlayerHistory = await evmOpenApi.mapPlayerHistory(ctx.http, tmpId, serverId, startTime, endTime);
32
35
  if (mapPlayerHistory.data.length === 0) {
33
36
  return `当日暂无数据`;
34
37
  }
@@ -40,7 +43,6 @@ module.exports = async (ctx, session, serverName) => {
40
43
  todayMileage: playerInfo.data.todayMileage,
41
44
  points: mapPlayerHistory.data
42
45
  };
43
- console.info(data.mapType);
44
46
  let page;
45
47
  try {
46
48
  page = await ctx.puppeteer.page();
@@ -127,7 +127,7 @@
127
127
  document.getElementById('avatar').src = data.smallAvatarUrl;
128
128
  }
129
129
 
130
- const points = data.points || [];
130
+ const points = (data.points || []).filter(p => !(p.axisX === 0 && p.axisY === 0 && p.heading === 0));
131
131
  // 使用传入的今日里程数据(米转千米)
132
132
  const mileage = data.todayMileage || 0;
133
133
  const km = (mileage / 1000).toFixed(1);
@@ -156,7 +156,7 @@
156
156
  timeDiff = (parseTime(curr.updateTime) - parseTime(prev.updateTime)) / 1000;
157
157
  } catch (e) { }
158
158
 
159
- const isTimeJump = timeDiff > 60;
159
+ const isTimeJump = timeDiff > 90;
160
160
  const isServerJump = prev.serverId !== curr.serverId;
161
161
 
162
162
  if (isDistJump || isTimeJump || isServerJump) {
Binary file
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.19.0",
4
+ "version": "1.19.2",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "homepage": "https://github.com/79887143/koishi-plugin-tmp-bot",