Class SlashCommandAttribute
Create an Slash Application Command.
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 SourceSlashCommandAttribute(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 SourceDescription
Gets the description of the Slash Command.
Declaration
public string Description { get; }
Property Value
Type | Description |
---|---|
String |
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 |
Name
Gets the name of the Slash Command.
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
String |
RunMode
Gets the run mode this command gets executed with.
Declaration
public RunMode RunMode { get; }
Property Value
Type | Description |
---|---|
RunMode |