koishi-plugin-tmp-bot 1.8.5 → 1.8.6

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.
@@ -16,7 +16,7 @@ module.exports = async (ctx, cfg, session, tmpId) => {
16
16
  }
17
17
 
18
18
  // 更新数据库
19
- guildBind.saveOrUpdate(ctx.database, session.platform, session.userId, session.author.username, tmpId)
19
+ guildBind.saveOrUpdate(ctx.database, session.platform, session.userId, tmpId)
20
20
 
21
21
  return `绑定成功 ( ${playerInfo.data.name} )`
22
22
  }
@@ -50,7 +50,7 @@ module.exports = async (ctx, cfg, session, tmpId) => {
50
50
  if (!areaPlayersData.error) {
51
51
  areaPlayerList = areaPlayersData.data
52
52
  let index = areaPlayerList.findIndex((player) => {
53
- return player.MpId.toString() === tmpId
53
+ return player.MpId.toString() === tmpId.toString()
54
54
  })
55
55
  if (index !== -1) {
56
56
  areaPlayerList.splice(index, 1)
@@ -22,21 +22,18 @@ module.exports = {
22
22
  * @param db 数据源
23
23
  * @param platform 平台
24
24
  * @param userId 用户编号
25
- * @param userName 用户昵称
26
25
  * @param tmpId TMP ID
27
26
  */
28
- saveOrUpdate (db, platform, userId, userName, tmpId) {
27
+ saveOrUpdate (db, platform, userId, tmpId) {
29
28
  this.get(db, platform, userId).then((data) => {
30
29
  if (data) {
31
30
  db.set('tmp_guild_bind', data.id, {
32
- tmp_id: tmpId,
33
- user_name: userName
31
+ tmp_id: tmpId
34
32
  })
35
33
  } else {
36
34
  db.create('tmp_guild_bind', {
37
35
  platform: platform,
38
36
  user_id: userId,
39
- user_name: userName,
40
37
  tmp_id: tmpId
41
38
  })
42
39
  }
@@ -21,12 +21,6 @@ const modelArray = {
21
21
  nullable: false,
22
22
  comment: '用户编号'
23
23
  },
24
- user_name: {
25
- type: 'string',
26
- length: 50,
27
- nullable: false,
28
- comment: '用户昵称'
29
- },
30
24
  tmp_id: {
31
25
  type: 'unsigned',
32
26
  length: 50,
@@ -0,0 +1,9 @@
1
+ module.exports = {
2
+ /**
3
+ * 路况信息展示方式
4
+ */
5
+ TmpTrafficType: {
6
+ text: 1, // 文本
7
+ heatMap: 2, // 热力图
8
+ }
9
+ }
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.8.5",
4
+ "version": "1.8.6",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "homepage": "https://github.com/79887143/koishi-plugin-tmp-bot",