optional

fun optional(component: CommandComponent.Builder<C, *>): MutableCommandBuilder<C>

Adds a new component to this command

Return

this mutable builder

Parameters

component

component to add


fun <T> optional(name: String, parser: ParserDescriptor<C, T>, mutator: CommandComponent.Builder<C, T>.() -> Unit = {}): MutableCommandBuilder<C>
fun <T> optional(name: CloudKey<T>, parser: ParserDescriptor<C, T>, mutator: CommandComponent.Builder<C, T>.() -> Unit = {}): MutableCommandBuilder<C>

Adds a new component to this command

Parameters

name

the name of the component

parser

the parser of the component

mutator

mutator of the component

T

the type of the component


fun optional(componentSupplier: () -> CommandComponent.Builder<C, *>): MutableCommandBuilder<C>

Add a new argument to this command

Return

this mutable builder

Parameters

componentSupplier

supplier of the component