Table of Contents

Constructor DiscordApplicationCommandOption

Namespace
DisCatSharp.Entities
Assembly
DisCatSharp.dll

DiscordApplicationCommandOption(string, string, ApplicationCommandOptionType, bool, IEnumerable<DiscordApplicationCommandOptionChoice>?, IEnumerable<DiscordApplicationCommandOption>?, IEnumerable<ChannelType>?, bool, object?, object?, DiscordApplicationCommandLocalization?, DiscordApplicationCommandLocalization?, int?, int?)

Creates a new instance of a DiscordApplicationCommandOption.

public DiscordApplicationCommandOption(string name, string description, ApplicationCommandOptionType type, bool required = false, IEnumerable<DiscordApplicationCommandOptionChoice>? choices = null, IEnumerable<DiscordApplicationCommandOption>? options = null, IEnumerable<ChannelType>? channelTypes = null, bool autocomplete = false, object? minimumValue = null, object? maximumValue = null, DiscordApplicationCommandLocalization? nameLocalizations = null, DiscordApplicationCommandLocalization? descriptionLocalizations = null, int? minimumLength = null, int? maximumLength = null)

Parameters

name string

The name of this parameter.

description string

The description of the parameter.

type ApplicationCommandOptionType

The type of this parameter.

required bool

Whether the parameter is required.

choices IEnumerable<DiscordApplicationCommandOptionChoice>

The optional choice selection for this parameter.

options IEnumerable<DiscordApplicationCommandOption>

The optional subcommands for this parameter.

channelTypes IEnumerable<ChannelType>

If the option is a channel type, the channels shown will be restricted to these types.

autocomplete bool

Whether this option provides autocompletion.

minimumValue object

The minimum value for this parameter. Only valid for types Integer or Number.

maximumValue object

The maximum value for this parameter. Only valid for types Integer or Number.

nameLocalizations DiscordApplicationCommandLocalization

The localizations of the parameter name.

descriptionLocalizations DiscordApplicationCommandLocalization

The localizations of the parameter description.

minimumLength int?

The minimum allowed length of the string. (Min 0)

maximumLength int?

The maximum allowed length of the string. (Min 1)