SlashCommandOption

Represents a Discord input option of a slash command.

Properties

Link copied to clipboard
abstract val choices: List<Command.Choice>?

The choices manually set on this option.

Link copied to clipboard
abstract override val command: SlashCommandInfo

The executable command this parameter is from.

Link copied to clipboard
abstract val context: BContext

The main context.

Link copied to clipboard
abstract val declaredName: String

The name of this option in the command/aggregator.

Link copied to clipboard
abstract val description: String

The description of this option.

Link copied to clipboard
abstract val discordName: String

The name of this option as shown on Discord.

Link copied to clipboard
abstract val index: Int

The index of this option in the command/aggregator.

Link copied to clipboard
abstract val isNullable: Boolean

Whether this option's value can be null.

Link copied to clipboard
abstract val isOptional: Boolean

Whether this option's value can be omitted.

Link copied to clipboard

Whether this option's value can either be omitted or null

Link copied to clipboard

Whether this option's value is required.

Link copied to clipboard
abstract val isVararg: Boolean

Whether this option is part of vararg parameter.

Link copied to clipboard
abstract val kParameter: KParameter

A parameter from either the command function, or from an aggregation function.

Link copied to clipboard
abstract val length: LengthRange?

The allowed length of this option.

Link copied to clipboard
abstract val nullValue: Any?

Fallback value when this option's resolver returned null.

Link copied to clipboard
abstract val range: ValueRange?

The allowed number range of this option.

Link copied to clipboard
abstract val type: KType

Generified type of the option.

Link copied to clipboard

Whether this option uses choices given by SlashParameterResolver.getPredefinedChoices.

Functions

Link copied to clipboard
abstract fun hasAutocomplete(): Boolean

Whether this option uses autocomplete

Link copied to clipboard
abstract fun invalidateAutocomplete()

Invalidates this option's autocomplete cache, if configured.