Table of Contents

Constructor DiscordApplicationCommandOption

Namespace
DSharpPlus.Entities
Assembly
DSharpPlus.dll

DiscordApplicationCommandOption(string, string, DiscordApplicationCommandOptionType, bool?, IEnumerable<DiscordApplicationCommandOptionChoice>, IEnumerable<DiscordApplicationCommandOption>, IEnumerable<DiscordChannelType>, bool?, object, object, IReadOnlyDictionary<string, string>, IReadOnlyDictionary<string, string>, int?, int?)

Creates a new instance of a DiscordApplicationCommandOption.

public DiscordApplicationCommandOption(string name, string description, DiscordApplicationCommandOptionType type, bool? required = null, IEnumerable<DiscordApplicationCommandOptionChoice> choices = null, IEnumerable<DiscordApplicationCommandOption> options = null, IEnumerable<DiscordChannelType> channelTypes = null, bool? autocomplete = null, object minValue = null, object maxValue = null, IReadOnlyDictionary<string, string> name_localizations = null, IReadOnlyDictionary<string, string> description_localizations = null, int? minLength = null, int? maxLength = null)

Parameters

name string

The name of this parameter.

description string

The description of the parameter.

type DiscordApplicationCommandOptionType

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<DiscordChannelType>

The channel types to be restricted to for this parameter, if of type Channel.

autocomplete bool?

Whether this parameter is autocomplete. If true, choices must not be provided.

minValue object

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

maxValue object

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

name_localizations IReadOnlyDictionary<string, string>

Name localizations for this parameter.

description_localizations IReadOnlyDictionary<string, string>

Description localizations for this parameter.

minLength int?

The minimum allowed length for this parameter. Only valid for type String.

maxLength int?

The maximum allowed length for this parameter. Only valid for type String.