Table of Contents

Class CommandInfo

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

Provides the information of a command.

public class CommandInfo
Inheritance
CommandInfo
Inherited Members

Remarks

This object contains the information of a command. This can include the module of the command, various descriptions regarding the command, and its RunMode.

Properties

Aliases

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

public IReadOnlyList<string> Aliases { get; }

Property Value

IReadOnlyList<string>

Attributes

Gets a list of attributes of the command.

public IReadOnlyList<Attribute> Attributes { get; }

Property Value

IReadOnlyList<Attribute>

HasVarArgs

Indicates whether the command accepts a paramsType[] for its parameter.

public bool HasVarArgs { get; }

Property Value

bool

IgnoreExtraArgs

Indicates whether extra arguments should be ignored for this command.

public bool IgnoreExtraArgs { get; }

Property Value

bool

Module

Gets the module that the command belongs in.

public ModuleInfo Module { get; }

Property Value

ModuleInfo

Name

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

public string Name { get; }

Property Value

string

Parameters

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

public IReadOnlyList<ParameterInfo> Parameters { get; }

Property Value

IReadOnlyList<ParameterInfo>

Preconditions

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

public IReadOnlyList<PreconditionAttribute> Preconditions { get; }

Property Value

IReadOnlyList<PreconditionAttribute>

Priority

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

public int Priority { get; }

Property Value

int

Remarks

Gets the remarks of the command.

public string Remarks { get; }

Property Value

string

Remarks

This field returns the summary of the command. Summary and Remarks can be useful in help commands and various implementation that fetches details of the command for the user.

RunMode

Gets the RunMode that is being used for the command.

public RunMode RunMode { get; }

Property Value

RunMode

Summary

Gets the summary of the command.

public string Summary { get; }

Property Value

string

Remarks

This field returns the summary of the command. Summary and Remarks can be useful in help commands and various implementation that fetches details of the command for the user.

Methods

CheckPreconditionsAsync(ICommandContext, IServiceProvider)

public Task<PreconditionResult> CheckPreconditionsAsync(ICommandContext context, IServiceProvider services = null)

Parameters

context ICommandContext
services IServiceProvider

Returns

Task<PreconditionResult>

ExecuteAsync(ICommandContext, ParseResult, IServiceProvider)

public Task<IResult> ExecuteAsync(ICommandContext context, ParseResult parseResult, IServiceProvider services)

Parameters

context ICommandContext
parseResult ParseResult
services IServiceProvider

Returns

Task<IResult>

ExecuteAsync(ICommandContext, IEnumerable<object>, IEnumerable<object>, IServiceProvider)

public Task<IResult> ExecuteAsync(ICommandContext context, IEnumerable<object> argList, IEnumerable<object> paramList, IServiceProvider services)

Parameters

context ICommandContext
argList IEnumerable<object>
paramList IEnumerable<object>
services IServiceProvider

Returns

Task<IResult>

ParseAsync(ICommandContext, int, SearchResult, PreconditionResult, IServiceProvider)

public Task<ParseResult> ParseAsync(ICommandContext context, int startIndex, SearchResult searchResult, PreconditionResult preconditionResult = null, IServiceProvider services = null)

Parameters

context ICommandContext
startIndex int
searchResult SearchResult
preconditionResult PreconditionResult
services IServiceProvider

Returns

Task<ParseResult>