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.
package/lib/command/tmpBind.js
CHANGED
|
@@ -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,
|
|
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,
|
|
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
|
}
|
package/lib/database/model.js
CHANGED
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.
|
|
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",
|