Table of Contents

Class SlashCommandAttribute

Namespace
Discord.Interactions
Assembly
Discord.Net.Interactions.dll

Create an Slash Application Command.

[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
public class SlashCommandAttribute : Attribute
Inheritance
SlashCommandAttribute
Inherited Members

Remarks

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

Constructors

SlashCommandAttribute(string, string, bool, RunMode)

Register a method as a Slash Command.

public SlashCommandAttribute(string name, string description, bool ignoreGroupNames = false, RunMode runMode = RunMode.Default)

Parameters

name string

Name of the command.

description string

Description of the command.

ignoreGroupNames bool

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

Description

Gets the description of the Slash Command.

public string Description { get; }

Property Value

string

IgnoreGroupNames

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

public bool IgnoreGroupNames { get; }

Property Value

bool

Name

Gets the name of the Slash Command.

public string Name { get; }

Property Value

string

RunMode

Gets the run mode this command gets executed with.

public RunMode RunMode { get; }

Property Value

RunMode