All Downloads are FREE. Search and download functionalities are using the official Maven repository.

me.jakejmattson.kutils.api.arguments.AnyArg.kt Maven / Gradle / Ivy

There is a newer version: 0.18.1
Show newest version
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