koishi-plugin-tmp-bot 1.18.3 → 1.18.5

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,8 +1,12 @@
1
1
  const dayjs = require('dayjs');
2
+ const dayjsRelativeTime = require('dayjs/plugin/relativeTime');
3
+ const dayjsLocaleZhCn = require('dayjs/locale/zh-cn');
2
4
  const guildBind = require('../../database/guildBind');
3
5
  const truckyAppApi = require('../../api/truckyAppApi');
4
6
  const evmOpenApi = require('../../api/evmOpenApi');
5
7
  const baiduTranslate = require('../../util/baiduTranslate');
8
+ dayjs.extend(dayjsRelativeTime);
9
+ dayjs.locale(dayjsLocaleZhCn);
6
10
  /**
7
11
  * 用户组
8
12
  */
@@ -97,6 +101,9 @@ module.exports = async (ctx, cfg, session, tmpId) => {
97
101
  message += ' - ';
98
102
  message += await baiduTranslate(ctx, cfg, playerMapInfo.data.location.poi.realName);
99
103
  }
104
+ else if (playerInfo.data.lastOnlineTime) {
105
+ message += '\n📶上次在线: ' + dayjs(playerInfo.data.lastOnlineTime).fromNow(false);
106
+ }
100
107
  }
101
108
  if (playerInfo.data.isSponsor) {
102
109
  message += '\n🎁赞助用户';
@@ -238,8 +238,8 @@
238
238
 
239
239
  if (titleElement) {
240
240
  const titles = {
241
- 1: '🚗 总行驶里程排行榜',
242
- 2: '🚗 今日行驶里程排行榜'
241
+ 1: '- 总行驶里程排行榜 -',
242
+ 2: '- 今日行驶里程排行榜 -'
243
243
  };
244
244
  const footerNotes = {
245
245
  1: '* 数据自 2025年8月23日 20:00 开始统计',
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.18.3",
4
+ "version": "1.18.5",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "homepage": "https://github.com/79887143/koishi-plugin-tmp-bot",
package/readme.md CHANGED
@@ -5,16 +5,18 @@
5
5
  欧洲卡车模拟2 TMP查询机器人
6
6
 
7
7
  ### 指令说明
8
- | 指令名称 | 指令介绍 | 使用示例 |
9
- |--------------|---------------------------------------------------------------------------------------------------------------------------------------------|-----------------|
10
- | tmpbind | 绑定 TMPID,绑定后使用其他指令时可省略输入 | tmpbind 123 |
11
- | tmpquery | 查询TMP玩家信息 | tmpquery 123 |
12
- | tmpposition | 查询玩家位置信息 | tmpposition 123 |
13
- | tmptraffic | 查询服务器热门地点路况信息,仅支持使用服务器简称查询,具体支持查询的服务器和服务器简称信息如下</br>Simulation 1 (简称: s1)</br>Simulation 2 (简称: s2)</br>ProMods (简称: p)</br>Arcade (简称: a) | tmptraffic s1 |
14
- | tmpserverats | 查询美卡服务器信息列表 | tmpserverats |
15
- | tmpserverets | 查询欧卡服务器信息列表 | tmpserverets |
16
- | tmpversion | 查询版本信息 | tmpversion |
17
- | tmpdlcmap | 地图DLC列表 | tmpdlcmap |
8
+ | 指令名称 | 指令介绍 | 使用示例 |
9
+ |------------------------|---------------------------------------------------------------------------------------------------------------------------------------------|------------------------|
10
+ | tmpbind | 绑定 TMPID,绑定后使用其他指令时可省略输入 | tmpbind 123 |
11
+ | tmpquery | 查询TMP玩家信息 | tmpquery 123 |
12
+ | tmpposition | 查询玩家位置信息 | tmpposition 123 |
13
+ | tmptraffic | 查询服务器热门地点路况信息,仅支持使用服务器简称查询,具体支持查询的服务器和服务器简称信息如下</br>Simulation 1 (简称: s1)</br>Simulation 2 (简称: s2)</br>ProMods (简称: p)</br>Arcade (简称: a) | tmptraffic s1 |
14
+ | tmpserverats | 查询美卡服务器信息列表 | tmpserverats |
15
+ | tmpserverets | 查询欧卡服务器信息列表 | tmpserverets |
16
+ | tmpversion | 查询版本信息 | tmpversion |
17
+ | tmpdlcmap | 地图DLC列表 | tmpdlcmap |
18
+ | tmpmileageranking | 总里程排行榜,数据从 2025年8月23日20:00 开始统计,绑定ID后可查看自己的排名 | tmpmileageranking |
19
+ | tmptodaymileageranking | 今日里程排行榜,每日0点重置数据,绑定ID后可查看自己的排名 | tmptodaymileageranking |
18
20
 
19
21
  ### TMP数据接口文档
20
22
  https://apifox.com/apidoc/shared/38508a88-5ff4-4b29-b724-41f9d3d3336a