Class CommandInfo
Provides the information of a command.
Assembly: Revolt.Net.Commands.dll​
View Source​
public class CommandInfo : object
Properties​
Module​
Gets the module that the command belongs in.
View Source​
public ModuleInfo Module { get; }
Name​
Gets the name of the command. If none is set, the first alias is used.
View Source​
public string Name { get; }
Summary​
Gets the summary of the command.
View Source​
public string Summary { get; }
Remarks​
Gets the remarks of the command.
View Source​
public string Remarks { get; }
Priority​
Gets the priority of the command. This is used when there are multiple overloads of the command.
View Source​
public int Priority { get; }
HasVarArgs​
Indicates whether the command accepts a params <see cref="!:Type"></see>[] for its
parameter.
View Source​
public bool HasVarArgs { get; }
IgnoreExtraArgs​
Indicates whether extra arguments should be ignored for this command.
View Source​
public bool IgnoreExtraArgs { get; }
RunMode​
Gets the Revolt.Commands.Info.CommandInfo.RunMode that is being used for the command.
View Source​
public RunMode RunMode { get; }
Aliases​
Gets a list of aliases defined by the Revolt.Commands.Attributes.AliasAttribute of the command.
View Source​
public IReadOnlyList<string> Aliases { get; }
Parameters​
Gets a list of information about the parameters of the command.
View Source​
public IReadOnlyList<ParameterInfo> Parameters { get; }
Preconditions​
Gets a list of preconditions defined by the Revolt.Commands.Attributes.PreconditionAttribute of the command.
View Source​
public IReadOnlyList<PreconditionAttribute> Preconditions { get; }
Attributes​
Gets a list of attributes of the command.
View Source​
public IReadOnlyList<Attribute> Attributes { get; }
Methods​
CheckPreconditionsAsync(ICommandContext, IServiceProvider)​
View Source​
public async Task<PreconditionResult> CheckPreconditionsAsync(ICommandContext context, IServiceProvider services = null)
Returns​
Task<Revolt.Commands.Results.PreconditionResult>
Parameters​
| Type | Name |
|---|---|
| Revolt.Commands.ICommandContext | context |
IServiceProvider | services |
ParseAsync(ICommandContext, Int32, SearchResult, PreconditionResult, IServiceProvider)​
View Source​
public async Task<ParseResult> ParseAsync(ICommandContext context, int startIndex, SearchResult searchResult, PreconditionResult preconditionResult = null, IServiceProvider services = null)
Returns​
Task<Revolt.Commands.Results.ParseResult>
Parameters​
| Type | Name |
|---|---|
| Revolt.Commands.ICommandContext | context |
System.Int32 | startIndex |
| Revolt.Commands.Results.SearchResult | searchResult |
| Revolt.Commands.Results.PreconditionResult | preconditionResult |
IServiceProvider | services |
ExecuteAsync(ICommandContext, ParseResult, IServiceProvider)​
View Source​
public Task<IResult> ExecuteAsync(ICommandContext context, ParseResult parseResult, IServiceProvider services)
Returns​
Task<Revolt.Commands.Results.IResult>
Parameters​
| Type | Name |
|---|---|
| Revolt.Commands.ICommandContext | context |
| Revolt.Commands.Results.ParseResult | parseResult |
IServiceProvider | services |
ExecuteAsync(ICommandContext, IEnumerable<Object>, IEnumerable<Object>, IServiceProvider)​
View Source​
public async Task<IResult> ExecuteAsync(ICommandContext context, IEnumerable<object> argList, IEnumerable<object> paramList, IServiceProvider services)
Returns​
Task<Revolt.Commands.Results.IResult>
Parameters​
| Type | Name |
|---|---|
| Revolt.Commands.ICommandContext | context |
IEnumerable<System.Object> | argList |
IEnumerable<System.Object> | paramList |
IServiceProvider | services |