Class DiscordApplicationCommandOption
Represents a parameter for a DiscordApplicationCommand.
Inheritance
Namespace: DisCatSharp.Entities
Assembly: DisCatSharp.dll
Syntax
public sealed class DiscordApplicationCommandOption
Constructors
| Improve this Doc View SourceDiscordApplicationCommandOption(String, String, ApplicationCommandOptionType, Nullable<Boolean>, IEnumerable<DiscordApplicationCommandOptionChoice>, IEnumerable<DiscordApplicationCommandOption>, IEnumerable<ChannelType>, Nullable<Boolean>, Object, Object, DiscordApplicationCommandLocalization, DiscordApplicationCommandLocalization)
Creates a new instance of a DiscordApplicationCommandOption.
Declaration
public DiscordApplicationCommandOption(string name, string description, ApplicationCommandOptionType type, bool? required = null, IEnumerable<DiscordApplicationCommandOptionChoice> choices = null, IEnumerable<DiscordApplicationCommandOption> options = null, IEnumerable<ChannelType> channelTypes = null, bool? autocomplete = null, object minimumValue = null, object maximumValue = null, DiscordApplicationCommandLocalization nameLocalizations = null, DiscordApplicationCommandLocalization descriptionLocalizations = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of this parameter. |
System.String | description | The description of the parameter. |
ApplicationCommandOptionType | type | The type of this parameter. |
System.Nullable<System.Boolean> | required | Whether the parameter is required. |
System.Collections.Generic.IEnumerable<DiscordApplicationCommandOptionChoice> | choices | The optional choice selection for this parameter. |
System.Collections.Generic.IEnumerable<DiscordApplicationCommandOption> | options | The optional subcommands for this parameter. |
System.Collections.Generic.IEnumerable<ChannelType> | channelTypes | If the option is a channel type, the channels shown will be restricted to these types. |
System.Nullable<System.Boolean> | autocomplete | Whether this option provides autocompletion. |
System.Object | minimumValue | The minimum value for this parameter. Only valid for types Integer or Number. |
System.Object | maximumValue | The maximum value for this parameter. Only valid for types Integer or Number. |
DiscordApplicationCommandLocalization | nameLocalizations | The localizations of the parameter name. |
DiscordApplicationCommandLocalization | descriptionLocalizations | The localizations of the parameter description. |
Properties
| Improve this Doc View SourceAutoComplete
Gets whether this option provides autocompletion.
Declaration
public bool? AutoComplete { get; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Boolean> |
ChannelTypes
Gets the optional allowed channel types.
Declaration
public IReadOnlyCollection<ChannelType> ChannelTypes { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyCollection<ChannelType> |
Choices
Gets the optional choices for this command parameter. Not applicable for auto-complete options.
Declaration
public IReadOnlyCollection<DiscordApplicationCommandOptionChoice> Choices { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyCollection<DiscordApplicationCommandOptionChoice> |
Description
Gets the description of this command parameter.
Declaration
public string Description { get; }
Property Value
Type | Description |
---|---|
System.String |
DescriptionLocalizations
Gets the description localizations.
Declaration
public DiscordApplicationCommandLocalization DescriptionLocalizations { get; }
Property Value
Type | Description |
---|---|
DiscordApplicationCommandLocalization |
MaximumValue
Gets the maximum value for this slash command parameter.
Declaration
public object MaximumValue { get; }
Property Value
Type | Description |
---|---|
System.Object |
MinimumValue
Gets the minimum value for this slash command parameter.
Declaration
public object MinimumValue { get; }
Property Value
Type | Description |
---|---|
System.Object |
Name
Gets the name of this command parameter.
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
System.String |
NameLocalizations
Gets the name localizations.
Declaration
public DiscordApplicationCommandLocalization NameLocalizations { get; }
Property Value
Type | Description |
---|---|
DiscordApplicationCommandLocalization |
Options
Gets the optional subcommand parameters for this parameter.
Declaration
public IReadOnlyCollection<DiscordApplicationCommandOption> Options { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyCollection<DiscordApplicationCommandOption> |
Required
Gets whether this command parameter is required.
Declaration
public bool? Required { get; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Boolean> |
Type
Gets the type of this command parameter.
Declaration
public ApplicationCommandOptionType Type { get; }
Property Value
Type | Description |
---|---|
ApplicationCommandOptionType |