KytaleCommandBuilder

value class KytaleCommandBuilder(val command: KytaleCommand)

KytaleCommand builder class

Parameters

command

The command being built

See also

Constructors

Link copied to clipboard
constructor(command: KytaleCommand)

Properties

Link copied to clipboard

Functions

Link copied to clipboard
fun alias(vararg aliases: String)

Adds aliases for the command

Link copied to clipboard
fun <W : WrappedArg<T>, T> defaultArg(name: String, description: String, wrapper: ArgWrapper<W, T>, defaultValue: T, defaultValueDescription: String): W

Adds a wrapped default argument to the command

fun <T> defaultArg(name: String, description: String, argType: ArgumentType<T>, defaultValue: T, defaultValueDescription: String): DefaultArg<T>

Adds a default argument to the command

Link copied to clipboard
fun executorAsync(block: KytaleCommandContext.(CommandContext) -> CompletableFuture<Void?>?)

Sets an asynchronous executor for the command

Link copied to clipboard
inline fun executorSync(crossinline block: KytaleCommandContext.(CommandContext) -> Unit)

Sets a synchronous executor for the command

Link copied to clipboard
fun flagArg(name: String, description: String): FlagArg

Adds a flag argument to the command

Link copied to clipboard
fun <T> listDefaultArg(name: String, description: String, argType: ArgumentType<T>, defaultValue: List<T>, defaultValueDescription: String): DefaultArg<List<T>>

Adds a list default argument to the command

Link copied to clipboard
fun <T> listOptionalArg(name: String, description: String, argType: ArgumentType<T>): OptionalArg<List<T>>

Adds a list optional argument to the command

Link copied to clipboard
fun <T> listRequiredArg(name: String, description: String, argType: ArgumentType<T>): RequiredArg<List<T>>

Adds a list required argument to the command

Link copied to clipboard
fun <W : WrappedArg<T>, T> optionalArg(name: String, description: String, wrapper: ArgWrapper<W, T>): W

Adds a wrapped optional argument to the command

fun <T> optionalArg(name: String, description: String, argType: ArgumentType<T>): OptionalArg<T>

Adds an optional argument to the command

Link copied to clipboard
fun owner(owner: CommandOwner)

Sets the command owner

Link copied to clipboard
fun <W : WrappedArg<T>, T> requiredArg(name: String, description: String, wrapper: ArgWrapper<W, T>): W

Adds a wrapped required argument to the command

fun <T> requiredArg(name: String, description: String, argType: ArgumentType<T>): RequiredArg<T>

Adds a required argument to the command

Link copied to clipboard
fun requirePermission(permission: String)

Requires a permission for the command

Link copied to clipboard
fun subcommand(name: String, description: String, block: KytaleCommandBuilder.() -> Unit): KytaleCommand

Adds a subcommand

Link copied to clipboard
fun variant(description: String, block: KytaleCommandBuilder.() -> Unit): KytaleCommand

Adds a usage variant