Table of Contents

Class CommandAttribute

Namespace
Discord.Commands
Assembly
Discord.Net.Commands.dll

Marks the execution information for a command.

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

Constructors

CommandAttribute()

Initializes a new instance of the Attribute class.

public CommandAttribute()

CommandAttribute(string)

Initializes a new CommandAttribute attribute with the specified name.

public CommandAttribute(string text)

Parameters

text string

The name of the command.

CommandAttribute(string, bool)

public CommandAttribute(string text, bool ignoreExtraArgs)

Parameters

text string
ignoreExtraArgs bool

CommandAttribute(string, bool, string, string[], string)

public CommandAttribute(string text, bool ignoreExtraArgs, string summary = null, string[] aliases = null, string remarks = null)

Parameters

text string
ignoreExtraArgs bool
summary string
aliases string[]
remarks string

Properties

Aliases

Marks the aliases for a command.

public string[] Aliases { get; set; }

Property Value

string[]

Remarks

AliasAttribute extends the base value of this if present.

IgnoreExtraArgs

public bool? IgnoreExtraArgs { get; }

Property Value

bool?

Remarks

Attaches remarks to your commands.

public string Remarks { get; set; }

Property Value

string

Remarks

RemainderAttribute overrides the value of this property if present.

RunMode

Specifies the RunMode of the command. This affects how the command is executed.

public RunMode RunMode { get; set; }

Property Value

RunMode

Summary

Attaches a summary to your command.

public string Summary { get; set; }

Property Value

string

Remarks

Summary overrides the value of this property if present.

Text

Gets the text that has been set to be recognized as a command.

public string Text { get; }

Property Value

string