Class ApplicationCommandOptionProperties
public class ApplicationCommandOptionProperties
- Inheritance
-
ApplicationCommandOptionProperties
- Inherited Members
Constructors
ApplicationCommandOptionProperties(ApplicationCommandOptionType, string, string)
public ApplicationCommandOptionProperties(ApplicationCommandOptionType type, string name, string description)
Parameters
type
ApplicationCommandOptionTypeType of the option.
name
stringName of the option (1-32 characters).
description
stringDescription 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
Choices
Choices for the user to pick from (max 25).
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("choices")]
public IEnumerable<ApplicationCommandOptionChoiceProperties>? Choices { get; set; }
Property Value
Description
Description of the option (1-100 characters).
[JsonPropertyName("description")]
public string Description { get; set; }
Property Value
DescriptionLocalizations
Localizations of Description (1-100 characters each).
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("description_localizations")]
public IReadOnlyDictionary<string, string>? DescriptionLocalizations { get; set; }
Property Value
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
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
Name
Name of the option (1-32 characters).
[JsonPropertyName("name")]
public string Name { get; set; }
Property Value
NameLocalizations
Localizations of Name (1-32 characters each).
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("name_localizations")]
public IReadOnlyDictionary<string, string>? NameLocalizations { get; set; }
Property Value
Options
Parameters for the option (max 25).
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("options")]
public IEnumerable<ApplicationCommandOptionProperties>? Options { get; set; }
Property Value
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
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
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
AddChoices(params ApplicationCommandOptionChoiceProperties[])
Choices for the user to pick from (max 25).
public ApplicationCommandOptionProperties AddChoices(params ApplicationCommandOptionChoiceProperties[] choices)
Parameters
choices
ApplicationCommandOptionChoiceProperties[]
Returns
AddChoices(IEnumerable<ApplicationCommandOptionChoiceProperties>)
Choices for the user to pick from (max 25).
public ApplicationCommandOptionProperties AddChoices(IEnumerable<ApplicationCommandOptionChoiceProperties> choices)
Parameters
Returns
AddOptions(params ApplicationCommandOptionProperties[])
Parameters for the option (max 25).
public ApplicationCommandOptionProperties AddOptions(params ApplicationCommandOptionProperties[] options)
Parameters
options
ApplicationCommandOptionProperties[]
Returns
AddOptions(IEnumerable<ApplicationCommandOptionProperties>)
Parameters for the option (max 25).
public ApplicationCommandOptionProperties AddOptions(IEnumerable<ApplicationCommandOptionProperties> options)
Parameters
Returns
WithAutocomplete(bool?)
If autocomplete interactions are enabled for the option.
public ApplicationCommandOptionProperties WithAutocomplete(bool? autocomplete = true)
Parameters
autocomplete
bool?
Returns
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
WithChoices(IEnumerable<ApplicationCommandOptionChoiceProperties>?)
Choices for the user to pick from (max 25).
public ApplicationCommandOptionProperties WithChoices(IEnumerable<ApplicationCommandOptionChoiceProperties>? choices)
Parameters
Returns
WithDescription(string)
Description of the option (1-100 characters).
public ApplicationCommandOptionProperties WithDescription(string description)
Parameters
description
string
Returns
WithDescriptionLocalizations(IReadOnlyDictionary<string, string>?)
Localizations of Description (1-100 characters each).
public ApplicationCommandOptionProperties WithDescriptionLocalizations(IReadOnlyDictionary<string, string>? descriptionLocalizations)
Parameters
descriptionLocalizations
IReadOnlyDictionary<string, string>
Returns
WithMaxLength(int?)
The maximum allowed length (0-6000).
public ApplicationCommandOptionProperties WithMaxLength(int? maxLength)
Parameters
maxLength
int?
Returns
WithMaxValue(double?)
The maximum value permitted.
public ApplicationCommandOptionProperties WithMaxValue(double? maxValue)
Parameters
maxValue
double?
Returns
WithMinLength(int?)
The minimum allowed length (0-6000).
public ApplicationCommandOptionProperties WithMinLength(int? minLength)
Parameters
minLength
int?
Returns
WithMinValue(double?)
The minimum value permitted.
public ApplicationCommandOptionProperties WithMinValue(double? minValue)
Parameters
minValue
double?
Returns
WithName(string)
Name of the option (1-32 characters).
public ApplicationCommandOptionProperties WithName(string name)
Parameters
name
string
Returns
WithNameLocalizations(IReadOnlyDictionary<string, string>?)
Localizations of Name (1-32 characters each).
public ApplicationCommandOptionProperties WithNameLocalizations(IReadOnlyDictionary<string, string>? nameLocalizations)
Parameters
nameLocalizations
IReadOnlyDictionary<string, string>
Returns
WithOptions(IEnumerable<ApplicationCommandOptionProperties>?)
Parameters for the option (max 25).
public ApplicationCommandOptionProperties WithOptions(IEnumerable<ApplicationCommandOptionProperties>? options)
Parameters
Returns
WithRequired(bool?)
If the parameter is required or optional, default false.
public ApplicationCommandOptionProperties WithRequired(bool? required = true)
Parameters
required
bool?
Returns
WithType(ApplicationCommandOptionType)
Type of the option.
public ApplicationCommandOptionProperties WithType(ApplicationCommandOptionType type)