Class SlashCommandChoiceAttribute
Gives a choice value to a parameter on a slash command.
Inheritance
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 |
---|---|---|
System.String | name | The name of the choice. |
System.Boolean | value | The System.Boolean value of the choice. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when |
System.ArgumentNullException | Thrown when |
SlashCommandChoiceAttribute(String, Double)
Initializes a new instance of SlashCommandChoiceAttribute.
Declaration
public SlashCommandChoiceAttribute(string name, double value)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the choice. |
System.Double | value | The System.Double value of the choice. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when |
System.ArgumentNullException | Thrown when |
SlashCommandChoiceAttribute(String, Int32)
Initializes a new instance of SlashCommandChoiceAttribute.
Declaration
public SlashCommandChoiceAttribute(string name, int value)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the choice. |
System.Int32 | value | The System.Int32 value of the choice. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when |
System.ArgumentNullException | Thrown when |
SlashCommandChoiceAttribute(String, String)
Initializes a new instance of SlashCommandChoiceAttribute.
Declaration
public SlashCommandChoiceAttribute(string name, string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the choice. |
System.String | value | The System.String value of the choice. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when |
System.ArgumentNullException | Thrown when |
System.ArgumentOutOfRangeException | Thrown when the |
Properties
| Improve this Doc View SourceBoolValue
The System.Boolean value of the choice.
Declaration
public bool? BoolValue { get; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Boolean> |
IntValue
The System.Int32 value of the choice.
Declaration
public int? IntValue { get; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Int32> |
Name
The name of the choice.
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
System.String |
NumberValue
The System.Double value of the choice.
Declaration
public double? NumberValue { get; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Double> |
StringValue
The System.String value of the choice.
Declaration
public string StringValue { get; }
Property Value
Type | Description |
---|---|
System.String |
Methods
| Improve this Doc View SourceObjectValue()
Get the System.Object value of the set value.
Declaration
public object ObjectValue()
Returns
Type | Description |
---|---|
System.Object | The value as an System.Object. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when no choice value is set. |