@@ -136,7 +136,7 @@ class Plugin : JavaPlugin() {
136
136
/* *
137
137
* Saves all default configs where configs do not exist and reloads data from file into memory
138
138
*/
139
- fun updateConfig (version : String ) {
139
+ private fun updateConfig (version : String ) {
140
140
this .saveDefaultConfig()
141
141
config.options().copyDefaults(true )
142
142
config.set(" version" , version)
@@ -182,7 +182,7 @@ class Plugin : JavaPlugin() {
182
182
val users = Connection .listUsers()
183
183
val found: Member = users.find { it.user.name + " #" + it.user.discriminator == discriminator } ? : return null
184
184
185
- val ua: UserAlias = UserAlias (player.uniqueId, found.user.id)
185
+ val ua = UserAlias (player.uniqueId, found.user.id)
186
186
requests.add(ua)
187
187
val msg = " Minecraft user '${server.getOfflinePlayer(ua.mcUuid).name} ' has requested to become associated with your Discord" +
188
188
" account. If this is you, respond '${Connection .JDA .selfUser.asMention} confirm'. If this is not" +
@@ -203,8 +203,8 @@ class Plugin : JavaPlugin() {
203
203
204
204
var response = " ${CC .YELLOW } Discord users:"
205
205
for (user in users) {
206
- if (user.user.isBot) response + = " \n ${CC .GOLD } - ${user.effectiveName} (Bot) | ${user.user.name} #${user.user.discriminator}${CC .RESET } "
207
- else response + = " \n ${CC .YELLOW } - ${user.effectiveName} | ${user.user.name} #${user.user.discriminator}${CC .RESET } "
206
+ response + = if (user.user.isBot) " \n ${CC .GOLD } - ${user.effectiveName} (Bot) | ${user.user.name} #${user.user.discriminator}${CC .RESET } "
207
+ else " \n ${CC .YELLOW } - ${user.effectiveName} | ${user.user.name} #${user.user.discriminator}${CC .RESET } "
208
208
}
209
209
return response.trim()
210
210
}
@@ -218,25 +218,25 @@ class Plugin : JavaPlugin() {
218
218
return " ${CC .YELLOW } No Discord members could be found. Either server is empty or an error has occurred."
219
219
220
220
var response = " "
221
- if (onlineUsers.filter { it.onlineStatus == OnlineStatus .ONLINE }.isNotEmpty() ) {
221
+ if (onlineUsers.any { it.onlineStatus == OnlineStatus .ONLINE }) {
222
222
response + = " \n ${CC .DARK_GREEN } Online:${CC .RESET } "
223
223
for (user in onlineUsers.filter { it.onlineStatus == OnlineStatus .ONLINE }) {
224
- if (user.user.isBot) response + = " \n ${CC .DARK_GREEN } - ${user.effectiveName} (Bot)${CC .RESET } "
225
- else response + = " \n ${CC .DARK_GREEN } - ${user.effectiveName}${CC .RESET } "
224
+ response + = if (user.user.isBot) " \n ${CC .DARK_GREEN } - ${user.effectiveName} (Bot)${CC .RESET } "
225
+ else " \n ${CC .DARK_GREEN } - ${user.effectiveName}${CC .RESET } "
226
226
}
227
227
}
228
- if (onlineUsers.filter { it.onlineStatus == OnlineStatus .IDLE }.isNotEmpty() ) {
228
+ if (onlineUsers.any { it.onlineStatus == OnlineStatus .IDLE }) {
229
229
response + = " \n ${CC .YELLOW } Idle:${CC .RESET } "
230
230
for (user in onlineUsers.filter { it.onlineStatus == OnlineStatus .IDLE }) {
231
- if (user.user.isBot) response + = " \n ${CC .YELLOW } - ${user.effectiveName} (Bot)${CC .RESET } "
232
- else response + = " \n ${CC .YELLOW } - ${user.effectiveName}${CC .RESET } "
231
+ response + = if (user.user.isBot) " \n ${CC .YELLOW } - ${user.effectiveName} (Bot)${CC .RESET } "
232
+ else " \n ${CC .YELLOW } - ${user.effectiveName}${CC .RESET } "
233
233
}
234
234
}
235
- if (onlineUsers.filter { it.onlineStatus == OnlineStatus .DO_NOT_DISTURB }.isNotEmpty() ) {
235
+ if (onlineUsers.any { it.onlineStatus == OnlineStatus .DO_NOT_DISTURB }) {
236
236
response + = " \n ${CC .RED } Do Not Disturb:${CC .RESET } "
237
237
for (user in onlineUsers.filter { it.onlineStatus == OnlineStatus .DO_NOT_DISTURB }) {
238
- if (user.user.isBot) response + = " \n ${CC .RED } - ${user.effectiveName} (Bot)${CC .RESET } "
239
- else response + = " \n ${CC .RED } - ${user.effectiveName}${CC .RESET } "
238
+ response + = if (user.user.isBot) " \n ${CC .RED } - ${user.effectiveName} (Bot)${CC .RESET } "
239
+ else " \n ${CC .RED } - ${user.effectiveName}${CC .RESET } "
240
240
}
241
241
}
242
242
0 commit comments