Skip to main content

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​
TypeNameDescription
ICollection<Revolt.Commands.Info.CommandInfo>commandsThe set of commands to be checked against.
Revolt.Commands.ICommandContextcontextThe current command context.
IServiceProviderproviderThe 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​
TypeNameDescription
Revolt.Commands.CommandServicecommandServiceThe desired command service class to check against.
Revolt.Commands.ICommandContextcontextThe current command context.
IServiceProviderproviderThe 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​
TypeNameDescription
Revolt.Commands.Info.ModuleInfomoduleThe module to be checked against.
Revolt.Commands.ICommandContextcontextThe current command context.
IServiceProviderproviderThe service provider used for dependency injection upon precondition check.