io.github.freya022.botcommands.api.commands.application.ValueRange.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of BotCommands Show documentation
Show all versions of BotCommands Show documentation
A Kotlin-first (and Java) framework that makes creating Discord bots a piece of cake, using the JDA library.
package io.github.freya022.botcommands.api.commands.application
class ValueRange private constructor(val min: Number, val max: Number) {
companion object {
@JvmStatic
fun ofLong(minValue: Long, maxValue: Long) =
ValueRange(minValue, maxValue)
@JvmStatic
fun ofDouble(minValue: Double, maxValue: Double) =
ValueRange(minValue, maxValue)
infix fun Long.range(maxValue: Long) = ValueRange(this, maxValue)
infix fun Int.range(maxValue: Int) = ValueRange(this, maxValue)
infix fun Double.range(maxValue: Double) = ValueRange(this, maxValue)
}
}