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