koishi-plugin-tmp-bot 1.19.1 → 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,10 +1,10 @@
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');
5
6
  const evmOpenApi = require('../api/evmOpenApi');
6
7
  const guildBind = require('../database/guildBind');
7
- const dayjs = require('dayjs');
8
8
  module.exports = async (ctx, session, serverName) => {
9
9
  if (!ctx.puppeteer) {
10
10
  return '未启用 puppeteer 服务';
@@ -43,7 +43,6 @@ module.exports = async (ctx, session, serverName) => {
43
43
  todayMileage: playerInfo.data.todayMileage,
44
44
  points: mapPlayerHistory.data
45
45
  };
46
- console.info(data.mapType);
47
46
  let page;
48
47
  try {
49
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.1",
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",