InteractionOptions

class InteractionOptions(commandInteraction: ApplicationCommandInteraction)

An experimental class for getting command options through property delegation.

Example:

val name: String by options
val count: Int by options
val enabled: Boolean by options
val user: Mono<User> by options
val channel: Mono<Channel> by options
val role: Mono<Role> by options

// also
val nullableName: String? by options.nullable()
val defaultName: String by options.defaultValue("test")

Constructors

InteractionOptions
Link copied to clipboard
fun InteractionOptions(commandInteraction: ApplicationCommandInteraction)

Types

DefaultValueOptionDelegate
Link copied to clipboard
inner class DefaultValueOptionDelegate<T>(value: T) : ReadOnlyProperty<Any?, T>
NullableOptionDelegate
Link copied to clipboard
inner class NullableOptionDelegate<T> : ReadOnlyProperty<Any?, T?>

Functions

contains
Link copied to clipboard
operator fun contains(name: String): Boolean
defaultValue
Link copied to clipboard
fun <T> defaultValue(value: T): InteractionOptions.DefaultValueOptionDelegate<T>
getValue
Link copied to clipboard
operator fun <T> getValue(thisRef: Any?, property: KProperty<*>): T
nullable
Link copied to clipboard
fun <T> nullable(): InteractionOptions.NullableOptionDelegate<T>

Sources

jvm source
Link copied to clipboard