createCommandOption

fun createCommandOption(type: ApplicationCommandType = ApplicationCommandType.STRING, name: String, description: String? = null, descriptionRes: Int? = null, required: Boolean = false, default: Boolean = false, channelTypes: List<Int?> = emptyList(), choices: List<CommandChoice> = emptyList(), subCommandOptions: List<ApplicationCommandOption> = emptyList(), autocomplete: Boolean = false): ApplicationCommandOption

Creates a CommandOption that can be used for commands

Parameters

type

The type of this argument

name

The name of this argument

description

The description of this argument

descriptionRes

Optional ID of a string resource that will be used as description

required

Whether this option is required

default

Whether this option is the default selection (I think so at least I'm not 100% sure lol)

channelTypes

Channel types this command is enabled in

choices

List of choices the user may pick from

subCommandOptions

List of command options if this argument is of type

autocomplete

Whether autocomplete is enabled


fun createCommandOption(type: ApplicationCommandType = ApplicationCommandType.STRING, name: String, description: String? = null, descriptionRes: Int? = null, required: Boolean = false, default: Boolean = false, channelTypes: List<Int?> = emptyList(), choices: List<CommandChoice> = emptyList(), subCommandOptions: List<ApplicationCommandOption> = emptyList(), autocomplete: Boolean = false, minValue: Number? = null, maxValue: Number? = null): ApplicationCommandOption

Creates a CommandOption that can be used for commands

Parameters

type

The type of this argument

name

The name of this argument

description

The description of this argument

descriptionRes

Optional ID of a string resource that will be used as description

required

Whether this option is required

default

Whether this option is the default selection (I think so at least I'm not 100% sure lol)

channelTypes

Channel types this command is enabled in

choices

List of choices the user may pick from

subCommandOptions

List of command options if this argument is of type

autocomplete

Whether autocomplete is enabled

minValue

minValue for number type options

maxValue

maxValue for number type options