Search Results for

    Show / Hide Table of Contents

    Class SlashCommandOptionInfo

    Contains all the information about a slash command option.

    Inheritance
    Object
    SlashCommandOptionInfo
    Implements
    ISlashCommandOptionInfo
    Inherited Members
    System.Object.Equals(System.Object)
    Object.Equals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    Object.ToString()
    Namespace: Color_Chan.Discord.Commands.Models.Info
    Assembly: Color-Chan.Discord.Commands.dll
    Syntax
    public class SlashCommandOptionInfo : ISlashCommandOptionInfo

    Constructors

    | Improve this Doc View Source

    SlashCommandOptionInfo(SlashCommandOptionAttribute, Type, IEnumerable<KeyValuePair<String, Object>>)

    Initializes a new instance of SlashCommandOptionInfo for a command option.

    Declaration
    public SlashCommandOptionInfo(SlashCommandOptionAttribute optionAttribute, Type type, IEnumerable<KeyValuePair<string, object>> choices = null)
    Parameters
    Type Name Description
    SlashCommandOptionAttribute optionAttribute

    The SlashCommandOptionAttribute containing all the data about the option.

    Type type

    The type of the parameter.

    System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<String, Object>> choices

    the choices that the command option has.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown when Name, Description or type is null.

    | Improve this Doc View Source

    SlashCommandOptionInfo(String, String, DiscordApplicationCommandOptionType)

    Initializes a new instance of SlashCommandOptionInfo for a sub command group.

    Declaration
    public SlashCommandOptionInfo(string name, string description, DiscordApplicationCommandOptionType type)
    Parameters
    Type Name Description
    String name

    The name of the sub command.

    String description

    The description of the sub command.

    DiscordApplicationCommandOptionType type

    The type of the option.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown when name, description is null.

    | Improve this Doc View Source

    SlashCommandOptionInfo(String, String, Boolean, MethodInfo, TypeInfo, IEnumerable<InteractionRequirementAttribute>, List<ISlashCommandOptionInfo>, IEnumerable<SlashCommandGuildAttribute>)

    Initializes a new instance of SlashCommandOptionInfo for a sub command.

    Declaration
    public SlashCommandOptionInfo(string name, string description, bool acknowledge, MethodInfo command, TypeInfo module, IEnumerable<InteractionRequirementAttribute> requirements = null, List<ISlashCommandOptionInfo> commandOptions = null, IEnumerable<SlashCommandGuildAttribute> guilds = null)
    Parameters
    Type Name Description
    String name

    The name of the sub command.

    String description

    The description of the sub command.

    Boolean acknowledge

    Whether or not the command should be automatically acknowledge to prevent the token from turning inactive after 3 seconds.

    System.Reflection.MethodInfo command

    The System.Reflection.MethodInfo containing the method of the command.

    System.Reflection.TypeInfo module

    The command module containing the CommandMethod.

    System.Collections.Generic.IEnumerable<InteractionRequirementAttribute> requirements

    A System.Collections.Generic.IEnumerable<T> of InteractionRequirementAttributes containing all the requirements to execute the command.

    List<ISlashCommandOptionInfo> commandOptions

    The System.Collections.Generic.IEnumerable<T> of ISlashCommandOptionInfo containing the options for the slash command.

    System.Collections.Generic.IEnumerable<SlashCommandGuildAttribute> guilds

    The System.Collections.Generic.IEnumerable<T> of SlashCommandGuildAttribute containing the IDs of the guilds that will get access to this slash command.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown when name, description is null.

    Properties

    | Improve this Doc View Source

    Acknowledge

    Whether or not the command should be automatically acknowledge to prevent the token from turning inactive after 3 seconds.

    Declaration
    public bool Acknowledge { get; }
    Property Value
    Type Description
    Boolean
    | Improve this Doc View Source

    Autocomplete

    Enable autocomplete interactions for this option.

    Declaration
    public bool? Autocomplete { get; set; }
    Property Value
    Type Description
    System.Nullable<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

    Choices

    A list of System.Collections.Generic.KeyValuePair`2 where each key is a choice name, and the value is the raw value of the choice.

    Declaration
    public IEnumerable<KeyValuePair<string, object>> Choices { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<String, Object>>
    | Improve this Doc View Source

    CommandMethod

    The System.Reflection.MethodInfo containing the method of the sub command.

    Declaration
    public MethodInfo CommandMethod { get; set; }
    Property Value
    Type Description
    System.Reflection.MethodInfo
    Remarks

    null when the option is not a sub command.

    | Improve this Doc View Source

    CommandOptions

    The options for the slash command.

    Declaration
    public List<ISlashCommandOptionInfo> CommandOptions { get; set; }
    Property Value
    Type Description
    List<ISlashCommandOptionInfo>
    Remarks

    null when the option is not a sub command, or when the sub command doesn't have any options.

    | Improve this Doc View Source

    Description

    The description of the option.

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

    Guilds

    A System.Collections.Generic.IEnumerable<T> of SlashCommandGuildAttribute containing the IDs of the guilds that will get access to this slash command.

    Declaration
    public IEnumerable<SlashCommandGuildAttribute> Guilds { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.IEnumerable<SlashCommandGuildAttribute>
    Remarks

    null when the option is not a sub command, or when it is a sub command but the command is global.

    | Improve this Doc View Source

    IsRequired

    Whether or not the option is required.

    Declaration
    public bool? IsRequired { get; set; }
    Property Value
    Type Description
    System.Nullable<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<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<Int32>
    | Improve this Doc View Source

    Name

    The name of the option..

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

    ParentModule

    The command module containing the CommandMethod.

    Declaration
    public TypeInfo ParentModule { get; set; }
    Property Value
    Type Description
    System.Reflection.TypeInfo
    Remarks

    null when the option is not a sub command.

    | Improve this Doc View Source

    Requirements

    A System.Collections.Generic.IEnumerable<T> of InteractionRequirementAttributes containing all the requirements to execute the command.

    Declaration
    public IEnumerable<InteractionRequirementAttribute> Requirements { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.IEnumerable<InteractionRequirementAttribute>
    Remarks

    null when the option is not a sub command, or when the sub command doesn't have any requirements.

    | Improve this Doc View Source

    Type

    The type of the parameter.

    Declaration
    public DiscordApplicationCommandOptionType Type { get; set; }
    Property Value
    Type Description
    DiscordApplicationCommandOptionType

    Implements

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