You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
val deleteTasks:MutableList<ActionTask>=ArrayList()
53
-
val createRoleTasks:MutableList<ActionTask>=ArrayList()
54
-
val createChannelTasks:MutableList<ActionTask>=ArrayList()
51
+
val deleteTasks= mutableListOf<ActionTask>()
52
+
val createRoleTasks= mutableListOf<ActionTask>()
53
+
val createChannelTasks= mutableListOf<ActionTask>()
55
54
56
55
// Phase 1: Identify deletions
57
-
val existingPlayerIds =LinkedList(players.keys)
56
+
val existingPlayerIds = players.keys.toMutableList()
58
57
for (idStr in existingPlayerIds) {
59
58
val pid = idStr.toInt()
60
59
if (pid > count) {
@@ -64,7 +63,7 @@ class PlayerServiceImpl(
64
63
deleteTasks.add(
65
64
ActionTask(
66
65
role.delete(),
67
-
"刪除身分組: "+role.name
66
+
"刪除身分組: ${role.name}"
68
67
)
69
68
)
70
69
}
@@ -73,7 +72,7 @@ class PlayerServiceImpl(
73
72
deleteTasks.add(
74
73
ActionTask(
75
74
channel.delete(),
76
-
"刪除頻道: "+channel.name
75
+
"刪除頻道: ${channel.name}"
77
76
)
78
77
)
79
78
}
@@ -164,7 +163,7 @@ class PlayerServiceImpl(
164
163
.orElseThrow { RuntimeException("Session not found") }
165
164
val player = session.players[playerId] ?:throwException("Player not found")
166
165
167
-
val finalRoles =ArrayList(roles)
166
+
val finalRoles = roles.toMutableList()
168
167
val isDuplicated = roles.contains("複製人")
169
168
player.duplicated = isDuplicated
170
169
if (isDuplicated && finalRoles.size ==2) {
@@ -187,8 +186,7 @@ class PlayerServiceImpl(
187
186
val guild = jda.getGuildById(guildId)
188
187
if (guild !=null) {
189
188
val channel = guild.getTextChannelById(player.channelId)
190
-
channel?.sendMessage("法官已將你的身份更改為: "+ roles.joinToString(", ")) // Converting List to varargs or just string join? String.join takes Iterable in Java 8+ but Kotlin standard library has joinToString.
0 commit comments