diff --git a/kord-extensions/src/main/kotlin/dev/kordex/core/commands/converters/impl/IntConverter.kt b/kord-extensions/src/main/kotlin/dev/kordex/core/commands/converters/impl/IntConverter.kt index 4a498bc581..b92e4be8f6 100644 --- a/kord-extensions/src/main/kotlin/dev/kordex/core/commands/converters/impl/IntConverter.kt +++ b/kord-extensions/src/main/kotlin/dev/kordex/core/commands/converters/impl/IntConverter.kt @@ -43,7 +43,16 @@ private const val DEFAULT_RADIX = 10 "public var maxValue: Int? = null", "public var minValue: Int? = null", - ] + ], + + builderExtraStatements = [ + "public var range: IntRange", + " get() = (minValue ?: Int.MIN_VALUE) .. (maxValue ?: Int.MAX_VALUE)\n", + " set(value) {\n" + + " minValue = value.first()\n" + + " maxValue = value.last()\n" + + " }", + ], ) public class IntConverter( private val radix: Int = DEFAULT_RADIX, diff --git a/kord-extensions/src/main/kotlin/dev/kordex/core/commands/converters/impl/LongConverter.kt b/kord-extensions/src/main/kotlin/dev/kordex/core/commands/converters/impl/LongConverter.kt index 6f9b8172a2..f287887f32 100644 --- a/kord-extensions/src/main/kotlin/dev/kordex/core/commands/converters/impl/LongConverter.kt +++ b/kord-extensions/src/main/kotlin/dev/kordex/core/commands/converters/impl/LongConverter.kt @@ -43,7 +43,16 @@ private const val DEFAULT_RADIX = 10 "public var maxValue: Long? = null", "public var minValue: Long? = null", - ] + ], + + builderExtraStatements = [ + "public var range: LongRange", + " get() = (minValue ?: Long.MIN_VALUE) .. (maxValue ?: Long.MAX_VALUE)\n", + " set(value) {\n" + + " minValue = value.first()\n" + + " maxValue = value.last()\n" + + " }", + ], ) public class LongConverter( private val radix: Int = DEFAULT_RADIX, diff --git a/test-bot/src/main/kotlin/dev/kordex/test/bot/extensions/ArgumentTestExtension.kt b/test-bot/src/main/kotlin/dev/kordex/test/bot/extensions/ArgumentTestExtension.kt index 449cebe2b1..eb4c78b6dc 100644 --- a/test-bot/src/main/kotlin/dev/kordex/test/bot/extensions/ArgumentTestExtension.kt +++ b/test-bot/src/main/kotlin/dev/kordex/test/bot/extensions/ArgumentTestExtension.kt @@ -29,7 +29,6 @@ import dev.kordex.core.i18n.toKey import dev.kordex.core.i18n.types.Key import dev.kordex.core.utils.suggestStringCollection import dev.kordex.core.utils.suggestStringMap -import dev.kordex.modules.func.mappings.i18n.generated.MappingsTranslations.Argument.MappingsChannel.typeName public class ArgumentTestExtension : Extension() { override val name: String = "kordex.test-args"