Class ChoiceAttribute
- Namespace
- Discord.Interactions
- Assembly
- Discord.Net.Interactions.dll
Add a pre-determined argument value to a command parameter.
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = true, Inherited = true)]
public class ChoiceAttribute : Attribute
- Inheritance
-
ChoiceAttribute
- Inherited Members
Constructors
ChoiceAttribute(string, double)
Create a parameter choice with type Number.
public ChoiceAttribute(string name, double value)
Parameters
ChoiceAttribute(string, int)
Create a parameter choice with type Integer.
public ChoiceAttribute(string name, int value)
Parameters
ChoiceAttribute(string, string)
Create a parameter choice with type String.
public ChoiceAttribute(string name, string value)
Parameters
Properties
Name
Gets the name of the choice.
public string Name { get; }
Property Value
Type
Gets the type of this choice.
public SlashCommandChoiceType Type { get; }
Property Value
Value
Gets the value that will be used whenever this choice is selected.
public object Value { get; }