me.jakejmattson.kutils.api.arguments.AnyArg.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of KUtils Show documentation
Show all versions of KUtils Show documentation
A Discord bot framework for Kotlin.
package me.jakejmattson.kutils.api.arguments
import me.jakejmattson.kutils.api.dsl.arguments.*
import me.jakejmattson.kutils.api.dsl.command.CommandEvent
open class AnyArg(override val name: String = "Any") : ArgumentType() {
companion object : AnyArg()
override fun convert(arg: String, args: List, event: CommandEvent<*>): ArgumentResult =
if (arg.isNotEmpty()) ArgumentResult.Success(arg) else ArgumentResult.Error("$name cannot be empty.")
override fun generateExamples(event: CommandEvent<*>) = listOf(name)
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy