Table of Contents

Class ApplicationCommandOptionProperties

Namespace
NetCord.Rest
Assembly
NetCord.dll
public class ApplicationCommandOptionProperties
Inheritance
ApplicationCommandOptionProperties
Inherited Members

Constructors

ApplicationCommandOptionProperties(ApplicationCommandOptionType, string, string)

public ApplicationCommandOptionProperties(ApplicationCommandOptionType type, string name, string description)

Parameters

type ApplicationCommandOptionType

Type of the option.

name string

Name of the option (1-32 characters).

description string

Description of the option (1-100 characters).

Properties

Autocomplete

If autocomplete interactions are enabled for the option.

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("autocomplete")]
public bool? Autocomplete { get; set; }

Property Value

bool?

ChannelTypes

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

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("channel_types")]
public IEnumerable<ChannelType>? ChannelTypes { get; set; }

Property Value

IEnumerable<ChannelType>

Choices

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

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("choices")]
public IEnumerable<ApplicationCommandOptionChoiceProperties>? Choices { get; set; }

Property Value

IEnumerable<ApplicationCommandOptionChoiceProperties>

Description

Description of the option (1-100 characters).

[JsonPropertyName("description")]
public string Description { get; set; }

Property Value

string

DescriptionLocalizations

Localizations of Description (1-100 characters each).

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("description_localizations")]
public IReadOnlyDictionary<string, string>? DescriptionLocalizations { get; set; }

Property Value

IReadOnlyDictionary<string, string>

MaxLength

The maximum allowed length (0-6000).

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("max_length")]
public int? MaxLength { get; set; }

Property Value

int?

MaxValue

The maximum value permitted.

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("max_value")]
public double? MaxValue { get; set; }

Property Value

double?

MinLength

The minimum allowed length (0-6000).

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("min_length")]
public int? MinLength { get; set; }

Property Value

int?

MinValue

The minimum value permitted.

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("min_value")]
public double? MinValue { get; set; }

Property Value

double?

Name

Name of the option (1-32 characters).

[JsonPropertyName("name")]
public string Name { get; set; }

Property Value

string

NameLocalizations

Localizations of Name (1-32 characters each).

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("name_localizations")]
public IReadOnlyDictionary<string, string>? NameLocalizations { get; set; }

Property Value

IReadOnlyDictionary<string, string>

Options

Parameters for the option (max 25).

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("options")]
public IEnumerable<ApplicationCommandOptionProperties>? Options { get; set; }

Property Value

IEnumerable<ApplicationCommandOptionProperties>

Required

If the parameter is required or optional, default false.

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("required")]
public bool? Required { get; set; }

Property Value

bool?

Type

Type of the option.

[JsonPropertyName("type")]
public ApplicationCommandOptionType Type { get; set; }

Property Value

ApplicationCommandOptionType

Methods

AddChannelTypes(params ChannelType[])

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

public ApplicationCommandOptionProperties AddChannelTypes(params ChannelType[] channelTypes)

Parameters

channelTypes ChannelType[]

Returns

ApplicationCommandOptionProperties

AddChannelTypes(IEnumerable<ChannelType>)

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

public ApplicationCommandOptionProperties AddChannelTypes(IEnumerable<ChannelType> channelTypes)

Parameters

channelTypes IEnumerable<ChannelType>

Returns

ApplicationCommandOptionProperties

AddChoices(params ApplicationCommandOptionChoiceProperties[])

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

public ApplicationCommandOptionProperties AddChoices(params ApplicationCommandOptionChoiceProperties[] choices)

Parameters

choices ApplicationCommandOptionChoiceProperties[]

Returns

ApplicationCommandOptionProperties

AddChoices(IEnumerable<ApplicationCommandOptionChoiceProperties>)

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

public ApplicationCommandOptionProperties AddChoices(IEnumerable<ApplicationCommandOptionChoiceProperties> choices)

Parameters

choices IEnumerable<ApplicationCommandOptionChoiceProperties>

Returns

ApplicationCommandOptionProperties

AddOptions(params ApplicationCommandOptionProperties[])

Parameters for the option (max 25).

public ApplicationCommandOptionProperties AddOptions(params ApplicationCommandOptionProperties[] options)

Parameters

options ApplicationCommandOptionProperties[]

Returns

ApplicationCommandOptionProperties

AddOptions(IEnumerable<ApplicationCommandOptionProperties>)

Parameters for the option (max 25).

public ApplicationCommandOptionProperties AddOptions(IEnumerable<ApplicationCommandOptionProperties> options)

Parameters

options IEnumerable<ApplicationCommandOptionProperties>

Returns

ApplicationCommandOptionProperties

WithAutocomplete(bool?)

If autocomplete interactions are enabled for the option.

public ApplicationCommandOptionProperties WithAutocomplete(bool? autocomplete = true)

Parameters

autocomplete bool?

Returns

ApplicationCommandOptionProperties

WithChannelTypes(IEnumerable<ChannelType>?)

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

public ApplicationCommandOptionProperties WithChannelTypes(IEnumerable<ChannelType>? channelTypes)

Parameters

channelTypes IEnumerable<ChannelType>

Returns

ApplicationCommandOptionProperties

WithChoices(IEnumerable<ApplicationCommandOptionChoiceProperties>?)

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

public ApplicationCommandOptionProperties WithChoices(IEnumerable<ApplicationCommandOptionChoiceProperties>? choices)

Parameters

choices IEnumerable<ApplicationCommandOptionChoiceProperties>

Returns

ApplicationCommandOptionProperties

WithDescription(string)

Description of the option (1-100 characters).

public ApplicationCommandOptionProperties WithDescription(string description)

Parameters

description string

Returns

ApplicationCommandOptionProperties

WithDescriptionLocalizations(IReadOnlyDictionary<string, string>?)

Localizations of Description (1-100 characters each).

public ApplicationCommandOptionProperties WithDescriptionLocalizations(IReadOnlyDictionary<string, string>? descriptionLocalizations)

Parameters

descriptionLocalizations IReadOnlyDictionary<string, string>

Returns

ApplicationCommandOptionProperties

WithMaxLength(int?)

The maximum allowed length (0-6000).

public ApplicationCommandOptionProperties WithMaxLength(int? maxLength)

Parameters

maxLength int?

Returns

ApplicationCommandOptionProperties

WithMaxValue(double?)

The maximum value permitted.

public ApplicationCommandOptionProperties WithMaxValue(double? maxValue)

Parameters

maxValue double?

Returns

ApplicationCommandOptionProperties

WithMinLength(int?)

The minimum allowed length (0-6000).

public ApplicationCommandOptionProperties WithMinLength(int? minLength)

Parameters

minLength int?

Returns

ApplicationCommandOptionProperties

WithMinValue(double?)

The minimum value permitted.

public ApplicationCommandOptionProperties WithMinValue(double? minValue)

Parameters

minValue double?

Returns

ApplicationCommandOptionProperties

WithName(string)

Name of the option (1-32 characters).

public ApplicationCommandOptionProperties WithName(string name)

Parameters

name string

Returns

ApplicationCommandOptionProperties

WithNameLocalizations(IReadOnlyDictionary<string, string>?)

Localizations of Name (1-32 characters each).

public ApplicationCommandOptionProperties WithNameLocalizations(IReadOnlyDictionary<string, string>? nameLocalizations)

Parameters

nameLocalizations IReadOnlyDictionary<string, string>

Returns

ApplicationCommandOptionProperties

WithOptions(IEnumerable<ApplicationCommandOptionProperties>?)

Parameters for the option (max 25).

public ApplicationCommandOptionProperties WithOptions(IEnumerable<ApplicationCommandOptionProperties>? options)

Parameters

options IEnumerable<ApplicationCommandOptionProperties>

Returns

ApplicationCommandOptionProperties

WithRequired(bool?)

If the parameter is required or optional, default false.

public ApplicationCommandOptionProperties WithRequired(bool? required = true)

Parameters

required bool?

Returns

ApplicationCommandOptionProperties

WithType(ApplicationCommandOptionType)

Type of the option.

public ApplicationCommandOptionProperties WithType(ApplicationCommandOptionType type)

Parameters

type ApplicationCommandOptionType

Returns

ApplicationCommandOptionProperties