koishi-plugin-tmp-bot 1.3.0 → 1.3.1

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.guildId, session.userId, session.author.username, tmpId)
19
+ guildBind.saveOrUpdate(ctx.database, session.platform, session.userId, session.author.username, tmpId)
20
20
 
21
21
  return `绑定成功 ( ${playerInfo.data.name} )`
22
22
  }
@@ -16,7 +16,7 @@ module.exports = async (ctx, cfg, session, tmpId) => {
16
16
 
17
17
  // 如果没有传入tmpId,尝试从数据库查询绑定信息
18
18
  if (!tmpId) {
19
- let guildBindData = await guildBind.get(ctx.database, session.platform, session.guildId, session.userId)
19
+ let guildBindData = await guildBind.get(ctx.database, session.platform, session.userId)
20
20
  if (!guildBindData) {
21
21
  return `请输入正确的玩家编号`
22
22
  }
@@ -24,7 +24,7 @@ module.exports = async (ctx, cfg, session, tmpId) => {
24
24
 
25
25
  // 如果没有传入tmpId,尝试从数据库查询绑定信息
26
26
  if (!tmpId) {
27
- let guildBindData = await guildBind.get(ctx.database, session.platform, session.guildId, session.userId)
27
+ let guildBindData = await guildBind.get(ctx.database, session.platform, session.userId)
28
28
  if (!guildBindData) {
29
29
  return `请输入正确的玩家编号`
30
30
  }
@@ -3,13 +3,11 @@ module.exports = {
3
3
  * 获取绑定信息
4
4
  * @param db 数据源
5
5
  * @param platform 平台
6
- * @param guildId 群组编号
7
6
  * @param userId 用户编号
8
7
  */
9
- async get (db, platform, guildId, userId) {
8
+ async get (db, platform, userId) {
10
9
  const guildBindList = await db.get('tmp_guild_bind', {
11
10
  platform,
12
- guild_id: guildId,
13
11
  user_id: userId
14
12
  })
15
13
 
@@ -23,13 +21,12 @@ module.exports = {
23
21
  * 新增或更新绑定信息
24
22
  * @param db 数据源
25
23
  * @param platform 平台
26
- * @param guildId 群组编号
27
24
  * @param userId 用户编号
28
25
  * @param userName 用户昵称
29
26
  * @param tmpId TMP ID
30
27
  */
31
- saveOrUpdate (db, platform, guildId, userId, userName, tmpId) {
32
- this.get(db, platform, guildId, userId).then((data) => {
28
+ saveOrUpdate (db, platform, userId, userName, tmpId) {
29
+ this.get(db, platform, userId).then((data) => {
33
30
  if (data) {
34
31
  db.set('tmp_guild_bind', data.id, {
35
32
  tmp_id: tmpId,
@@ -38,7 +35,6 @@ module.exports = {
38
35
  } else {
39
36
  db.create('tmp_guild_bind', {
40
37
  platform: platform,
41
- guild_id: guildId,
42
38
  user_id: userId,
43
39
  user_name: userName,
44
40
  tmp_id: tmpId
@@ -15,12 +15,6 @@ const modelArray = {
15
15
  nullable: false,
16
16
  comment: '所属平台'
17
17
  },
18
- guild_id: {
19
- type: 'string',
20
- length: 50,
21
- nullable: false,
22
- comment: '群组编号'
23
- },
24
18
  user_id: {
25
19
  type: 'string',
26
20
  length: 50,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-tmp-bot",
3
3
  "description": "欧洲卡车模拟2 TMP查询机器人",
4
- "version": "1.3.0",
4
+ "version": "1.3.1",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [