Text Option Registry
Functions
Link copied to clipboard
Declares a custom option, such as an TextLocalizationContext (with @LocalizationBundle).
Link copied to clipboard
abstract fun generatedOption(declaredName: String, generatedValueSupplier: TextGeneratedValueSupplier)
Declares a generated option, the supplier gets called on each command execution.
Link copied to clipboard
inline fun <T : OptionAggregateBuilder<T>> OptionAggregateBuilderContainer<T>.inlineClassAggregate(declaredName: String, noinline block: T.(valueName: String) -> Unit)
inline fun <T : OptionAggregateBuilder<T>> OptionAggregateBuilderContainer<T>.inlineClassAggregate(declaredName: String, noinline block: T.(valueParameter: KParameter, valueName: String) -> Unit)
inline fun <T : OptionAggregateBuilder<T>> OptionAggregateBuilderContainer<T>.inlineClassAggregate(declaredName: String, clazz: KClass<*>, crossinline block: T.(valueName: String) -> Unit)
fun <T : OptionAggregateBuilder<T>> OptionAggregateBuilderContainer<T>.inlineClassAggregate(declaredName: String, clazz: KClass<*>, block: T.(valueParameter: KParameter, valueName: String) -> Unit)
Declares an aggregate creating an instance of the specified inline class, which can only accept a single option.
Link copied to clipboard
inline fun <T : Any> TextOptionRegistry.inlineClassOption(declaredName: String, optionName: String? = null, noinline block: TextCommandOptionBuilder.() -> Unit = {})
fun TextOptionRegistry.inlineClassOption(declaredName: String, optionName: String? = null, clazz: KClass<*>, block: TextCommandOptionBuilder.() -> Unit = {})
Declares an input option encapsulated in an inline class.
Link copied to clipboard
inline fun <T : Any> TextOptionRegistry.inlineClassOptionVararg(declaredName: String, amount: Int, requiredAmount: Int, noinline optionNameSupplier: (Int) -> String, noinline block: TextCommandOptionBuilder.(Int) -> Unit = {})
fun TextOptionRegistry.inlineClassOptionVararg(declaredName: String, clazz: KClass<*>, amount: Int, requiredAmount: Int, optionNameSupplier: (Int) -> String, block: TextCommandOptionBuilder.(Int) -> Unit = {})
Declares multiple input options encapsulated in an inline class.
Link copied to clipboard
abstract fun option(declaredName: String, optionName: String = declaredName.toDiscordString(), block: TextCommandOptionBuilder.() -> Unit = {})
Declares an input option, supported types and modifiers are in ParameterResolver, additional types can be added by implementing TextParameterResolver.
Link copied to clipboard
abstract fun optionVararg(declaredName: String, amount: Int, requiredAmount: Int, optionNameSupplier: (Int) -> String, block: TextCommandOptionBuilder.(Int) -> Unit = {})
Declares multiple input options in a single parameter.
Link copied to clipboard
Declares a service option, allowing injection of services, which must be available.