Search Results for

    Show / Hide Table of Contents

    Class SlashCommandChoiceAttribute

    Gives a choice value to a parameter on a slash command.

    Inheritance
    System.Object
    System.Attribute
    SlashCommandChoiceAttribute
    Inherited Members
    System.Attribute.Equals(System.Object)
    System.Attribute.GetCustomAttribute(System.Reflection.Assembly, System.Type)
    System.Attribute.GetCustomAttribute(System.Reflection.Assembly, System.Type, System.Boolean)
    System.Attribute.GetCustomAttribute(System.Reflection.MemberInfo, System.Type)
    System.Attribute.GetCustomAttribute(System.Reflection.MemberInfo, System.Type, System.Boolean)
    System.Attribute.GetCustomAttribute(System.Reflection.Module, System.Type)
    System.Attribute.GetCustomAttribute(System.Reflection.Module, System.Type, System.Boolean)
    System.Attribute.GetCustomAttribute(System.Reflection.ParameterInfo, System.Type)
    System.Attribute.GetCustomAttribute(System.Reflection.ParameterInfo, System.Type, System.Boolean)
    System.Attribute.GetCustomAttributes(System.Reflection.Assembly)
    System.Attribute.GetCustomAttributes(System.Reflection.Assembly, System.Boolean)
    System.Attribute.GetCustomAttributes(System.Reflection.Assembly, System.Type)
    System.Attribute.GetCustomAttributes(System.Reflection.Assembly, System.Type, System.Boolean)
    System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo)
    System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo, System.Boolean)
    System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo, System.Type)
    System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo, System.Type, System.Boolean)
    System.Attribute.GetCustomAttributes(System.Reflection.Module)
    System.Attribute.GetCustomAttributes(System.Reflection.Module, System.Boolean)
    System.Attribute.GetCustomAttributes(System.Reflection.Module, System.Type)
    System.Attribute.GetCustomAttributes(System.Reflection.Module, System.Type, System.Boolean)
    System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo)
    System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo, System.Boolean)
    System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo, System.Type)
    System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo, System.Type, System.Boolean)
    System.Attribute.GetHashCode()
    System.Attribute.IsDefaultAttribute()
    System.Attribute.IsDefined(System.Reflection.Assembly, System.Type)
    System.Attribute.IsDefined(System.Reflection.Assembly, System.Type, System.Boolean)
    System.Attribute.IsDefined(System.Reflection.MemberInfo, System.Type)
    System.Attribute.IsDefined(System.Reflection.MemberInfo, System.Type, System.Boolean)
    System.Attribute.IsDefined(System.Reflection.Module, System.Type)
    System.Attribute.IsDefined(System.Reflection.Module, System.Type, System.Boolean)
    System.Attribute.IsDefined(System.Reflection.ParameterInfo, System.Type)
    System.Attribute.IsDefined(System.Reflection.ParameterInfo, System.Type, System.Boolean)
    System.Attribute.Match(System.Object)
    System.Attribute.TypeId
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    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 Source

    SlashCommandChoiceAttribute(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 name or value doesn't match the command name requirements.

    System.ArgumentNullException

    Thrown when name.

    | Improve this Doc View Source

    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 name or value doesn't match the command name requirements.

    System.ArgumentNullException

    Thrown when name.

    | Improve this Doc View Source

    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 name or value doesn't match the command name requirements.

    System.ArgumentNullException

    Thrown when name.

    | Improve this Doc View Source

    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 name or value doesn't match the command name requirements.

    System.ArgumentNullException

    Thrown when name or value is null.

    System.ArgumentOutOfRangeException

    Thrown when the name value is to short or to long.

    Properties

    | Improve this Doc View Source

    BoolValue

    The System.Boolean value of the choice.

    Declaration
    public bool? BoolValue { get; }
    Property Value
    Type Description
    System.Nullable<System.Boolean>
    | Improve this Doc View Source

    IntValue

    The System.Int32 value of the choice.

    Declaration
    public int? IntValue { get; }
    Property Value
    Type Description
    System.Nullable<System.Int32>
    | Improve this Doc View Source

    Name

    The name of the choice.

    Declaration
    public string Name { get; }
    Property Value
    Type Description
    System.String
    | Improve this Doc View Source

    NumberValue

    The System.Double value of the choice.

    Declaration
    public double? NumberValue { get; }
    Property Value
    Type Description
    System.Nullable<System.Double>
    | Improve this Doc View Source

    StringValue

    The System.String value of the choice.

    Declaration
    public string StringValue { get; }
    Property Value
    Type Description
    System.String

    Methods

    | Improve this Doc View Source

    ObjectValue()

    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.

    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX