Skip to main content

Class CommandInfo

Provides the information of a command.

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

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 <see cref="!:Type"></see>[] 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 Revolt.Commands.Info.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 Revolt.Commands.Attributes.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 Revolt.Commands.Attributes.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​

Task<Revolt.Commands.Results.PreconditionResult>

Parameters​
TypeName
Revolt.Commands.ICommandContextcontext
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​

Task<Revolt.Commands.Results.ParseResult>

Parameters​
TypeName
Revolt.Commands.ICommandContextcontext
System.Int32startIndex
Revolt.Commands.Results.SearchResultsearchResult
Revolt.Commands.Results.PreconditionResultpreconditionResult
IServiceProviderservices

ExecuteAsync(ICommandContext, ParseResult, IServiceProvider)​

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

Task<Revolt.Commands.Results.IResult>

Parameters​
TypeName
Revolt.Commands.ICommandContextcontext
Revolt.Commands.Results.ParseResultparseResult
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​

Task<Revolt.Commands.Results.IResult>

Parameters​
TypeName
Revolt.Commands.ICommandContextcontext
IEnumerable<System.Object>argList
IEnumerable<System.Object>paramList
IServiceProviderservices