Search Results for

    Show / Hide Table of Contents

    Class SlashCommandAttribute

    Create an Slash Application Command.

    Inheritance
    Object
    SlashCommandAttribute
    Namespace: Discord.Interactions
    Assembly: Discord.Net.Interactions.dll
    Syntax
    public class SlashCommandAttribute : Attribute
    Remarks

    GroupAttribute prefix will be used to created nested Slash Application Commands.

    Constructors

    | Improve this Doc View Source

    SlashCommandAttribute(String, String, Boolean, RunMode)

    Register a method as a Slash Command.

    Declaration
    public SlashCommandAttribute(string name, string description, bool ignoreGroupNames = false, RunMode runMode = RunMode.Default)
    Parameters
    Type Name Description
    String name

    Name of the command.

    String description

    Description of the command.

    Boolean ignoreGroupNames

    If true, GroupAttributes will be ignored while creating this command and this method will be treated as a top level command.

    RunMode runMode

    Set the run mode of the command.

    Properties

    | Improve this Doc View Source

    Description

    Gets the description of the Slash Command.

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

    IgnoreGroupNames

    Gets true if GroupAttributes will be ignored while creating this command and this method will be treated as a top level command.

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

    Name

    Gets the name of the Slash Command.

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

    RunMode

    Gets the run mode this command gets executed with.

    Declaration
    public RunMode RunMode { get; }
    Property Value
    Type Description
    RunMode

    Theme

    • Improve this Doc
    • View Source
    In This Article
    Back to top Discord.Net (c) 2015-2022 3.9.0