Table of Contents

Class ApplicationCommandOption

Namespace
NetCord.Rest
Assembly
NetCord.dll
public class ApplicationCommandOption : IJsonModel<JsonApplicationCommandOption>, ISpanFormattable, IFormattable
Inheritance
ApplicationCommandOption
Implements
Inherited Members

Constructors

ApplicationCommandOption(JsonApplicationCommandOption, string, ulong)

public ApplicationCommandOption(JsonApplicationCommandOption jsonModel, string parentName, ulong parentId)

Parameters

jsonModel JsonApplicationCommandOption
parentName string
parentId ulong

Properties

Autocomplete

If autocomplete interactions are enabled for the option.

public bool Autocomplete { get; }

Property Value

bool

ChannelTypes

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

public IReadOnlyList<ChannelType>? ChannelTypes { get; }

Property Value

IReadOnlyList<ChannelType>

Choices

Choices for the user to pick from (max 25).

public IReadOnlyList<ApplicationCommandOptionChoice>? Choices { get; }

Property Value

IReadOnlyList<ApplicationCommandOptionChoice>

Description

Description of the option (1-100 characters).

public string Description { get; }

Property Value

string

DescriptionLocalizations

Localizations of Description (1-100 characters each).

public IReadOnlyDictionary<string, string>? DescriptionLocalizations { get; }

Property Value

IReadOnlyDictionary<string, string>

MaxLength

The maximum allowed length (0-6000).

public int? MaxLength { get; }

Property Value

int?

MaxValue

The maximum value permitted.

public double? MaxValue { get; }

Property Value

double?

MinLength

The minimum allowed length (0-6000).

public int? MinLength { get; }

Property Value

int?

MinValue

The minimum value permitted.

public double? MinValue { get; }

Property Value

double?

Name

Name of the option (1-32 characters).

public string Name { get; }

Property Value

string

NameLocalizations

Localizations of Name (1-32 characters each).

public IReadOnlyDictionary<string, string>? NameLocalizations { get; }

Property Value

IReadOnlyDictionary<string, string>

Options

Parameters for the option (max 25).

public IReadOnlyList<ApplicationCommandOption>? Options { get; }

Property Value

IReadOnlyList<ApplicationCommandOption>

Required

If the parameter is required or optional.

public bool Required { get; }

Property Value

bool

Type

Type of the option.

public ApplicationCommandOptionType Type { get; }

Property Value

ApplicationCommandOptionType

Methods

ToString()

public override string ToString()

Returns

string

ToString(string?, IFormatProvider?)

public string ToString(string? format, IFormatProvider? formatProvider)

Parameters

format string
formatProvider IFormatProvider

Returns

string

TryFormat(Span<char>, out int, ReadOnlySpan<char>, IFormatProvider?)

public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format = default, IFormatProvider? provider = null)

Parameters

destination Span<char>
charsWritten int
format ReadOnlySpan<char>
provider IFormatProvider

Returns

bool