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
stringName of the command.
description
stringDescription of the command.
ignoreGroupNames
boolIf true, GroupAttributes will be ignored while creating this command and this method will be treated as a top level command.
runMode
RunModeSet the run mode of the command.
Properties
Description
Gets the description of the Slash Command.
public string Description { get; }
Property Value
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
Name
Gets the name of the Slash Command.
public string Name { get; }
Property Value
RunMode
Gets the run mode this command gets executed with.
public RunMode RunMode { get; }