Class CommandInfo
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
Attributes
Gets a list of attributes of the command.
public IReadOnlyList<Attribute> Attributes { get; }
Property Value
HasVarArgs
public bool HasVarArgs { get; }
Property Value
IgnoreExtraArgs
Indicates whether extra arguments should be ignored for this command.
public bool IgnoreExtraArgs { get; }
Property Value
Module
Gets the module that the command belongs in.
public ModuleInfo Module { get; }
Property Value
Name
Gets the name of the command. If none is set, the first alias is used.
public string Name { get; }
Property Value
Parameters
Gets a list of information about the parameters of the command.
public IReadOnlyList<ParameterInfo> Parameters { get; }
Property Value
Preconditions
Gets a list of preconditions defined by the PreconditionAttribute of the command.
public IReadOnlyList<PreconditionAttribute> Preconditions { get; }
Property Value
Priority
Gets the priority of the command. This is used when there are multiple overloads of the command.
public int Priority { get; }
Property Value
Remarks
Gets the remarks of the command.
public string Remarks { get; }
Property Value
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
Summary
Gets the summary of the command.
public string Summary { get; }
Property Value
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
ICommandContextservices
IServiceProvider
Returns
ExecuteAsync(ICommandContext, ParseResult, IServiceProvider)
public Task<IResult> ExecuteAsync(ICommandContext context, ParseResult parseResult, IServiceProvider services)
Parameters
context
ICommandContextparseResult
ParseResultservices
IServiceProvider
Returns
ExecuteAsync(ICommandContext, IEnumerable<object>, IEnumerable<object>, IServiceProvider)
public Task<IResult> ExecuteAsync(ICommandContext context, IEnumerable<object> argList, IEnumerable<object> paramList, IServiceProvider services)
Parameters
context
ICommandContextargList
IEnumerable<object>paramList
IEnumerable<object>services
IServiceProvider
Returns
ParseAsync(ICommandContext, int, SearchResult, PreconditionResult, IServiceProvider)
public Task<ParseResult> ParseAsync(ICommandContext context, int startIndex, SearchResult searchResult, PreconditionResult preconditionResult = null, IServiceProvider services = null)
Parameters
context
ICommandContextstartIndex
intsearchResult
SearchResultpreconditionResult
PreconditionResultservices
IServiceProvider