Class SlashCommandChoiceAttribute
Gives a choice value to a parameter on a slash command.
Inherited Members
Namespace: Color_Chan.Discord.Commands.Attributes
Assembly: Color-Chan.Discord.Commands.dll
Syntax
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = true)]
public class SlashCommandChoiceAttribute : Attribute
Constructors
| Improve this Doc View SourceSlashCommandChoiceAttribute(String, Boolean)
Initializes a new instance of SlashCommandChoiceAttribute.
Declaration
public SlashCommandChoiceAttribute(string name, bool value)
Parameters
Type | Name | Description |
---|---|---|
String | name | The name of the choice. |
Boolean | value | The Boolean value of the choice. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when |
ArgumentNullException | Thrown when |
SlashCommandChoiceAttribute(String, Double)
Initializes a new instance of SlashCommandChoiceAttribute.
Declaration
public SlashCommandChoiceAttribute(string name, double value)
Parameters
Type | Name | Description |
---|---|---|
String | name | The name of the choice. |
Double | value | The Double value of the choice. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when |
ArgumentNullException | Thrown when |
SlashCommandChoiceAttribute(String, Int32)
Initializes a new instance of SlashCommandChoiceAttribute.
Declaration
public SlashCommandChoiceAttribute(string name, int value)
Parameters
Type | Name | Description |
---|---|---|
String | name | The name of the choice. |
Int32 | value | The Int32 value of the choice. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when |
ArgumentNullException | Thrown when |
SlashCommandChoiceAttribute(String, String)
Initializes a new instance of SlashCommandChoiceAttribute.
Declaration
public SlashCommandChoiceAttribute(string name, string value)
Parameters
Type | Name | Description |
---|---|---|
String | name | The name of the choice. |
String | value | The String value of the choice. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when |
ArgumentNullException | Thrown when |
System.ArgumentOutOfRangeException | Thrown when the |
Properties
| Improve this Doc View SourceBoolValue
The Boolean value of the choice.
Declaration
public bool? BoolValue { get; }
Property Value
Type | Description |
---|---|
System.Nullable<Boolean> |
IntValue
The Int32 value of the choice.
Declaration
public int? IntValue { get; }
Property Value
Type | Description |
---|---|
System.Nullable<Int32> |
Name
The name of the choice.
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
String |
NumberValue
The Double value of the choice.
Declaration
public double? NumberValue { get; }
Property Value
Type | Description |
---|---|
System.Nullable<Double> |
StringValue
The String value of the choice.
Declaration
public string StringValue { get; }
Property Value
Type | Description |
---|---|
String |
Methods
| Improve this Doc View SourceObjectValue()
Get the Object value of the set value.
Declaration
public object ObjectValue()
Returns
Type | Description |
---|---|
Object | The value as an Object. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when no choice value is set. |