optionVararg

abstract fun optionVararg(declaredName: String, amount: Int, requiredAmount: Int, optionNameSupplier: (Int) -> String, block: SlashCommandOptionBuilder.(Int) -> Unit = {})(source)

Declares multiple input options in a single parameter.

The parameter's type needs to be a List, where the element type is supported by ParameterResolver.

Additional types can be added by implementing SlashParameterResolver.

Parameters

declaredName

Name of the declared parameter which receives the value of the combined options

amount

How many options to generate

requiredAmount

How many of the generated options are required

optionNameSupplier

Block generating an option name from the option's index

See also