Skip to main content

Class CommandInfo

Provides the information of a command.

Assembly: Discord.Net.Commands.dll​
View Source​
Declaration
public class CommandInfo

Properties​

Module​

Gets the module that the command belongs in.

View Source​
Declaration
public ModuleInfo Module { get; }

Name​

Gets the name of the command. If none is set, the first alias is used.

View Source​
Declaration
public string Name { get; }

Summary​

Gets the summary of the command.

View Source​
Declaration
public string Summary { get; }

Remarks​

Gets the remarks of the command.

View Source​
Declaration
public string Remarks { get; }

Priority​

Gets the priority of the command. This is used when there are multiple overloads of the command.

View Source​
Declaration
public int Priority { get; }

HasVarArgs​

Indicates whether the command accepts a params System.Type[] for its parameter.

View Source​
Declaration
public bool HasVarArgs { get; }

IgnoreExtraArgs​

Indicates whether extra arguments should be ignored for this command.

View Source​
Declaration
public bool IgnoreExtraArgs { get; }

RunMode​

Gets the Discord.Commands.CommandInfo.RunMode that is being used for the command.

View Source​
Declaration
public RunMode RunMode { get; }

Aliases​

Gets a list of aliases defined by the Discord.Commands.AliasAttribute of the command.

View Source​
Declaration
public IReadOnlyList<string> Aliases { get; }

Parameters​

Gets a list of information about the parameters of the command.

View Source​
Declaration
public IReadOnlyList<ParameterInfo> Parameters { get; }

Preconditions​

Gets a list of preconditions defined by the Discord.Commands.PreconditionAttribute of the command.

View Source​
Declaration
public IReadOnlyList<PreconditionAttribute> Preconditions { get; }

Attributes​

Gets a list of attributes of the command.

View Source​
Declaration
public IReadOnlyList<Attribute> Attributes { get; }

Methods​

CheckPreconditionsAsync(ICommandContext, IServiceProvider)​

View Source​
Declaration
public async Task<PreconditionResult> CheckPreconditionsAsync(ICommandContext context, IServiceProvider services = null)
Returns​

System.Threading.Tasks.Task<Discord.Commands.PreconditionResult>

Parameters​
TypeName
Discord.Commands.ICommandContextcontext
System.IServiceProviderservices

ParseAsync(ICommandContext, Int32, SearchResult, PreconditionResult, IServiceProvider)​

View Source​
Declaration
public async Task<ParseResult> ParseAsync(ICommandContext context, int startIndex, SearchResult searchResult, PreconditionResult preconditionResult = null, IServiceProvider services = null)
Returns​

System.Threading.Tasks.Task<Discord.Commands.ParseResult>

Parameters​
TypeName
Discord.Commands.ICommandContextcontext
System.Int32startIndex
Discord.Commands.SearchResultsearchResult
Discord.Commands.PreconditionResultpreconditionResult
System.IServiceProviderservices

ExecuteAsync(ICommandContext, ParseResult, IServiceProvider)​

View Source​
Declaration
public Task<IResult> ExecuteAsync(ICommandContext context, ParseResult parseResult, IServiceProvider services)
Returns​

System.Threading.Tasks.Task<Discord.Commands.IResult>

Parameters​
TypeName
Discord.Commands.ICommandContextcontext
Discord.Commands.ParseResultparseResult
System.IServiceProviderservices

ExecuteAsync(ICommandContext, IEnumerable<Object>, IEnumerable<Object>, IServiceProvider)​

View Source​
Declaration
public async Task<IResult> ExecuteAsync(ICommandContext context, IEnumerable<object> argList, IEnumerable<object> paramList, IServiceProvider services)
Returns​

System.Threading.Tasks.Task<Discord.Commands.IResult>

Parameters​
TypeName
Discord.Commands.ICommandContextcontext
System.Collections.Generic.IEnumerable<System.Object>argList
System.Collections.Generic.IEnumerable<System.Object>paramList
System.IServiceProviderservices