koishi-plugin-tmp-bot 1.12.0 → 1.13.0

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.
@@ -41,13 +41,13 @@ module.exports = async (ctx, cfg, session, tmpId) => {
41
41
 
42
42
  // 查询线上信息
43
43
  let playerMapInfo = await truckyAppApi.online(ctx.http, tmpId)
44
- if (playerMapInfo.error) {
45
- return '查询玩家信息失败,请重试'
46
- }
47
44
 
48
45
  // 拼接消息模板
49
- let message = `<img src="${playerInfo.data.avatar}"/>`
50
- message += '\n🆔TMP编号: ' + playerInfo.data.id
46
+ let message = ''
47
+ if (cfg.queryShowAvatarEnable) {
48
+ message += `<img src="${playerInfo.data.avatar}"/>\n`
49
+ }
50
+ message += '🆔TMP编号: ' + playerInfo.data.id
51
51
  message += '\n😀玩家名称: ' + playerInfo.data.name
52
52
  message += '\n🎮SteamID: ' + playerInfo.data.steamID64
53
53
  let registerDate = dayjs(playerInfo.data.joinDate + 'Z')
@@ -85,12 +85,14 @@ module.exports = async (ctx, cfg, session, tmpId) => {
85
85
  }
86
86
  }
87
87
  message += '\n🚫封禁次数: ' + playerInfo.data.bansCount || 0
88
- message += '\n📶在线状态: ' + (playerMapInfo.data.online ? `在线🟢 (${playerMapInfo.data.serverDetails.name})` : '离线⚫')
89
- if (playerMapInfo.data.online) {
90
- message += '\n🌍线上位置: '
91
- message += await baiduTranslate(ctx, cfg, playerMapInfo.data.location.poi.country)
92
- message += ' - '
93
- message += await baiduTranslate(ctx, cfg, playerMapInfo.data.location.poi.realName)
88
+ if (playerMapInfo && !playerMapInfo.error) {
89
+ message += '\n📶在线状态: ' + (playerMapInfo.data.online ? `在线🟢 (${playerMapInfo.data.serverDetails.name})` : '离线⚫')
90
+ if (playerMapInfo.data.online) {
91
+ message += '\n🌍线上位置: '
92
+ message += await baiduTranslate(ctx, cfg, playerMapInfo.data.location.poi.country)
93
+ message += ' - '
94
+ message += await baiduTranslate(ctx, cfg, playerMapInfo.data.location.poi.realName)
95
+ }
94
96
  }
95
97
  let patreon = playerInfo.data.patreon
96
98
  if (patreon && patreon.active) {
package/lib/index.js CHANGED
@@ -22,6 +22,7 @@ exports.Config = koishi_1.Schema.intersect([
22
22
  baiduTranslateCacheEnable: koishi_1.Schema.boolean().default(false).description('启用百度翻译缓存')
23
23
  }).description('基本配置'),
24
24
  koishi_1.Schema.object({
25
+ queryShowAvatarEnable: koishi_1.Schema.boolean().default(false).description('查询指令展示头像,部分玩家的擦边头像可能导致封号'),
25
26
  tmpTrafficType: koishi_1.Schema.union([
26
27
  koishi_1.Schema.const(1).description('文字'),
27
28
  koishi_1.Schema.const(2).description('热力图')
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.12.0",
4
+ "version": "1.13.0",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "homepage": "https://github.com/79887143/koishi-plugin-tmp-bot",