Class ChoiceAttribute
Add a pre-determined argument value to a command parameter.
Namespace: Discord.Interactions
Assembly: Discord.Net.Interactions.dll
Syntax
public class ChoiceAttribute : Attribute
Constructors
| Improve this Doc View SourceChoiceAttribute(String, Double)
Create a parameter choice with type Number.
Declaration
public ChoiceAttribute(string name, double value)
Parameters
Type | Name | Description |
---|---|---|
String | name | Name of the choice. |
Double | value | Predefined value of the choice. |
ChoiceAttribute(String, Int32)
Create a parameter choice with type Integer.
Declaration
public ChoiceAttribute(string name, int value)
Parameters
Type | Name | Description |
---|---|---|
String | name | Name of the choice. |
Int32 | value | Predefined value of the choice. |
ChoiceAttribute(String, String)
Create a parameter choice with type String.
Declaration
public ChoiceAttribute(string name, string value)
Parameters
Type | Name | Description |
---|---|---|
String | name | Name of the choice. |
String | value | Predefined value of the choice. |
Properties
| Improve this Doc View SourceName
Gets the name of the choice.
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
String |
Type
Gets the type of this choice.
Declaration
public SlashCommandChoiceType Type { get; }
Property Value
Type | Description |
---|---|
SlashCommandChoiceType |
Value
Gets the value that will be used whenever this choice is selected.
Declaration
public object Value { get; }
Property Value
Type | Description |
---|---|
Object |