fix update checker output format

This commit is contained in:
NikkyAI 2018-02-17 17:26:02 +01:00
parent aad5365d19
commit 4545b7d38a
1 changed files with 4 additions and 3 deletions

View File

@ -55,8 +55,9 @@ class UpdateChecker : Runnable {
val latest= possibleUpdates[0] val latest= possibleUpdates[0]
possibleUpdates.sortByDescending { it.fileName.substringAfter(" ") } possibleUpdates.sortByDescending { it.fileName.substringAfter(" ") }
val version = if(possibleUpdates.count() == 1) "version" else "versions" val count = possibleUpdates.count()
instance.info("Matterlink out of date! You are {} $version behind", possibleUpdates.count()) val version = if(count == 1) "version" else "versions"
instance.info("Matterlink out of date! You are $count $version behind")
possibleUpdates.forEach { possibleUpdates.forEach {
instance.info("version: {} download: {}", it.fileName, it.downloadURL) instance.info("version: {} download: {}", it.fileName, it.downloadURL)
} }
@ -64,7 +65,7 @@ class UpdateChecker : Runnable {
instance.warn("Mod out of date! New $version available at ${latest.downloadURL}") instance.warn("Mod out of date! New $version available at ${latest.downloadURL}")
MessageHandler.transmit(ApiMessage( MessageHandler.transmit(ApiMessage(
username = cfg.relay.systemUser, username = cfg.relay.systemUser,
text = "Matterlink out of date! You are {} $version behind! Please download new version from ${latest.downloadURL}" text = "Matterlink out of date! You are $count $version behind! Please download new version from ${latest.downloadURL}"
)) ))
} }