Search Results for

    Show / Hide Table of Contents

    Class SlashCommandOptionAttribute

    Makes a parameter available as an slash command option.

    Inheritance
    System.Object
    System.Attribute
    SlashCommandOptionAttribute
    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)]
    public class SlashCommandOptionAttribute : Attribute

    Constructors

    | Improve this Doc View Source

    SlashCommandOptionAttribute(String, String)

    Initializes a new instance of SlashCommandOptionAttribute.

    Declaration
    public SlashCommandOptionAttribute(string name, string description)
    Parameters
    Type Name Description
    System.String name

    The name of the option.

    System.String description

    The description of the option.

    Exceptions
    Type Condition
    System.ArgumentNullException

    Thrown when name or description is null.

    | Improve this Doc View Source

    SlashCommandOptionAttribute(String, String, DiscordApplicationCommandOptionType)

    Initializes a new instance of SlashCommandOptionAttribute.

    Declaration
    public SlashCommandOptionAttribute(string name, string description, DiscordApplicationCommandOptionType type)
    Parameters
    Type Name Description
    System.String name

    The name of the option.

    System.String description

    The description of the option.

    DiscordApplicationCommandOptionType type

    The type of the option. Will be automatically set to the correct type when set to null.

    Exceptions
    Type Condition
    System.ArgumentNullException

    Thrown when name or description is null.

    | Improve this Doc View Source

    SlashCommandOptionAttribute(String, String, DiscordApplicationCommandOptionType, DiscordChannelType[])

    Initializes a new instance of SlashCommandOptionAttribute.

    Declaration
    public SlashCommandOptionAttribute(string name, string description, DiscordApplicationCommandOptionType type, params DiscordChannelType[] chanelTypes)
    Parameters
    Type Name Description
    System.String name

    The name of the option.

    System.String description

    The description of the option.

    DiscordApplicationCommandOptionType type

    The type of the option. Will be automatically set to the correct type when set to null.

    DiscordChannelType[] chanelTypes

    The channel type that will be shown if the supplied option type is set to Channel.

    Exceptions
    Type Condition
    System.ArgumentNullException

    Thrown when name or description is null.

    | Improve this Doc View Source

    SlashCommandOptionAttribute(String, String, DiscordApplicationCommandOptionType, Int32, Int32)

    Initializes a new instance of SlashCommandOptionAttribute.

    Declaration
    public SlashCommandOptionAttribute(string name, string description, DiscordApplicationCommandOptionType type, int min, int max)
    Parameters
    Type Name Description
    System.String name

    The name of the option.

    System.String description

    The description of the option.

    DiscordApplicationCommandOptionType type

    The type of the option. Will be automatically set to the correct type when set to null.

    System.Int32 min

    The minimum value if the supplied option type is set to Integer or Number.

    System.Int32 max

    The maximum value if the supplied option type is set to Integer or Number.

    Exceptions
    Type Condition
    System.ArgumentNullException

    Thrown when name or description is null.

    | Improve this Doc View Source

    SlashCommandOptionAttribute(String, String, Boolean)

    Initializes a new instance of SlashCommandOptionAttribute.

    Declaration
    public SlashCommandOptionAttribute(string name, string description, bool isRequired)
    Parameters
    Type Name Description
    System.String name

    The name of the option.

    System.String description

    The description of the option.

    System.Boolean isRequired

    Whether or not the option is required.

    Exceptions
    Type Condition
    System.ArgumentException

    Thrown when name or description doesn't match the command name requirements.

    System.ArgumentNullException

    Thrown when name or description is null.

    | Improve this Doc View Source

    SlashCommandOptionAttribute(String, String, Boolean, DiscordApplicationCommandOptionType)

    Initializes a new instance of SlashCommandOptionAttribute.

    Declaration
    public SlashCommandOptionAttribute(string name, string description, bool isRequired, DiscordApplicationCommandOptionType type)
    Parameters
    Type Name Description
    System.String name

    The name of the option.

    System.String description

    The description of the option.

    System.Boolean isRequired

    Whether or not the option is required.

    DiscordApplicationCommandOptionType type

    The type of the option. Will be automatically set to the correct type when set to null.

    Exceptions
    Type Condition
    System.ArgumentException

    Thrown when name or description doesn't match the command name requirements.

    System.ArgumentNullException

    Thrown when name or description is null.

    | Improve this Doc View Source

    SlashCommandOptionAttribute(String, String, Boolean, DiscordApplicationCommandOptionType, DiscordChannelType[])

    Initializes a new instance of SlashCommandOptionAttribute.

    Declaration
    public SlashCommandOptionAttribute(string name, string description, bool isRequired, DiscordApplicationCommandOptionType type, params DiscordChannelType[] chanelTypes)
    Parameters
    Type Name Description
    System.String name

    The name of the option.

    System.String description

    The description of the option.

    System.Boolean isRequired

    Whether or not the option is required.

    DiscordApplicationCommandOptionType type

    The type of the option. Will be automatically set to the correct type when set to null.

    DiscordChannelType[] chanelTypes

    The channel type that will be shown if the supplied option type is set to Channel.

    Exceptions
    Type Condition
    System.ArgumentException

    Thrown when name or description doesn't match the command name requirements.

    System.ArgumentNullException

    Thrown when name or description is null.

    | Improve this Doc View Source

    SlashCommandOptionAttribute(String, String, Boolean, DiscordApplicationCommandOptionType, Int32, Int32)

    Initializes a new instance of SlashCommandOptionAttribute.

    Declaration
    public SlashCommandOptionAttribute(string name, string description, bool isRequired, DiscordApplicationCommandOptionType type, int min, int max)
    Parameters
    Type Name Description
    System.String name

    The name of the option.

    System.String description

    The description of the option.

    System.Boolean isRequired

    Whether or not the option is required.

    DiscordApplicationCommandOptionType type

    The type of the option. Will be automatically set to the correct type when set to null.

    System.Int32 min

    The minimum value if the supplied option type is set to Integer or Number.

    System.Int32 max

    The maximum value if the supplied option type is set to Integer or Number.

    Exceptions
    Type Condition
    System.ArgumentException

    Thrown when name or description doesn't match the command name requirements.

    System.ArgumentNullException

    Thrown when name or description is null.

    Properties

    | Improve this Doc View Source

    Autocomplete

    Enable autocomplete interactions for this option.

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

    ChanelTypes

    If the option is a channel type, the channels shown will be restricted to these types.

    Declaration
    public IEnumerable<DiscordChannelType> ChanelTypes { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.IEnumerable<DiscordChannelType>
    | Improve this Doc View Source

    Description

    The description of the option.

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

    IsRequired

    Whether or not the option is required.

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

    MaxValue

    If the option is an INTEGER or NUMBER type, the maximum value permitted.

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

    MinValue

    If the option is an INTEGER or NUMBER type, the minimum value permitted.

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

    Name

    The name of the option..

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

    Type

    The type of the option. Will be automatically set to the correct type when set to null.

    Declaration
    public DiscordApplicationCommandOptionType? Type { get; }
    Property Value
    Type Description
    System.Nullable<DiscordApplicationCommandOptionType>
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX