Class CommandServiceExtensions
Provides extension methods for the Revolt.Commands.CommandService class.
Assembly: Revolt.Net.Commands.dll​
View Source​
Declaration
public static class CommandServiceExtensions : object
Methods​
GetExecutableCommandsAsync(ICollection<CommandInfo>, ICommandContext, IServiceProvider)​
Returns commands that can be executed under the current context.
View Source​
Declaration
public static async Task<IReadOnlyCollection<CommandInfo>> GetExecutableCommandsAsync(this ICollection<CommandInfo> commands, ICommandContext context, IServiceProvider provider)
Returns​
Task<IReadOnlyCollection<Revolt.Commands.Info.CommandInfo>>:
A read-only collection of commands that can be executed under the current context.
Parameters​
| Type | Name | Description |
|---|---|---|
ICollection<Revolt.Commands.Info.CommandInfo> | commands | The set of commands to be checked against. |
| Revolt.Commands.ICommandContext | context | The current command context. |
IServiceProvider | provider | The service provider used for dependency injection upon precondition check. |
GetExecutableCommandsAsync(CommandService, ICommandContext, IServiceProvider)​
Returns commands that can be executed under the current context.
View Source​
Declaration
public static Task<IReadOnlyCollection<CommandInfo>> GetExecutableCommandsAsync(this CommandService commandService, ICommandContext context, IServiceProvider provider)
Returns​
Task<IReadOnlyCollection<Revolt.Commands.Info.CommandInfo>>:
A read-only collection of commands that can be executed under the current context.
Parameters​
| Type | Name | Description |
|---|---|---|
| Revolt.Commands.CommandService | commandService | The desired command service class to check against. |
| Revolt.Commands.ICommandContext | context | The current command context. |
IServiceProvider | provider | The service provider used for dependency injection upon precondition check. |
GetExecutableCommandsAsync(ModuleInfo, ICommandContext, IServiceProvider)​
Returns commands that can be executed under the current context.
View Source​
Declaration
public static async Task<IReadOnlyCollection<CommandInfo>> GetExecutableCommandsAsync(this ModuleInfo module, ICommandContext context, IServiceProvider provider)
Returns​
Task<IReadOnlyCollection<Revolt.Commands.Info.CommandInfo>>:
A read-only collection of commands that can be executed under the current context.
Parameters​
| Type | Name | Description |
|---|---|---|
| Revolt.Commands.Info.ModuleInfo | module | The module to be checked against. |
| Revolt.Commands.ICommandContext | context | The current command context. |
IServiceProvider | provider | The service provider used for dependency injection upon precondition check. |