diff --git a/src/main/kotlin/xyz/jpenilla/announcerplus/config/message/MessageConfig.kt b/src/main/kotlin/xyz/jpenilla/announcerplus/config/message/MessageConfig.kt index 253a6c9..3897e8e 100644 --- a/src/main/kotlin/xyz/jpenilla/announcerplus/config/message/MessageConfig.kt +++ b/src/main/kotlin/xyz/jpenilla/announcerplus/config/message/MessageConfig.kt @@ -289,12 +289,15 @@ class MessageConfig : SelfSavable, KoinComponent { private fun zeroToOne(): ConfigurationTransformation = ConfigurationTransformation.chain( ConfigurationTransformation.builder().addAction(path("interval-time-amount"), TransformAction.rename("interval-time")).build(), - ConfigurationTransformation.builder().addAction(path("interval-time"), TransformAction { path, value -> - val oldUnit = value.parent()?.node("interval-time-unit")?.get() ?: TimeUnit.MINUTES - val oldNum = value.string ?: "3" - value.set("$oldNum ${oldUnit.name.lowercase()}") - return@TransformAction null - }).build(), + ConfigurationTransformation.builder().addAction( + path("interval-time"), + TransformAction { path, value -> + val oldUnit = value.parent()?.node("interval-time-unit")?.get() ?: TimeUnit.MINUTES + val oldNum = value.string ?: "3" + value.set("$oldNum ${oldUnit.name.lowercase()}") + return@TransformAction null + } + ).build(), ConfigurationTransformation.builder().addAction(path("interval-time-unit"), TransformAction.remove()).build() )