Class CommandInfo
Provides the information of a command.
Assembly: Discord.Net.Commands.dll​
View Source​
public class CommandInfo
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
System.Type
[] 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 Discord.Commands.CommandInfo.RunMode that is being used for the command.
View Source​
public RunMode RunMode { get; }
Aliases​
Gets a list of aliases defined by the Discord.Commands.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 Discord.Commands.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​
System.Threading.Tasks.Task<Discord.Commands.PreconditionResult>
Parameters​
Type | Name |
---|---|
Discord.Commands.ICommandContext | context |
System.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​
System.Threading.Tasks.Task<Discord.Commands.ParseResult>
Parameters​
Type | Name |
---|---|
Discord.Commands.ICommandContext | context |
System.Int32 | startIndex |
Discord.Commands.SearchResult | searchResult |
Discord.Commands.PreconditionResult | preconditionResult |
System.IServiceProvider | services |
ExecuteAsync(ICommandContext, ParseResult, IServiceProvider)​
View Source​
public Task<IResult> ExecuteAsync(ICommandContext context, ParseResult parseResult, IServiceProvider services)
Returns​
System.Threading.Tasks.Task<Discord.Commands.IResult>
Parameters​
Type | Name |
---|---|
Discord.Commands.ICommandContext | context |
Discord.Commands.ParseResult | parseResult |
System.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​
System.Threading.Tasks.Task<Discord.Commands.IResult>
Parameters​
Type | Name |
---|---|
Discord.Commands.ICommandContext | context |
System.Collections.Generic.IEnumerable<System.Object> | argList |
System.Collections.Generic.IEnumerable<System.Object> | paramList |
System.IServiceProvider | services |