Table of Contents

Class CommandServiceExtensions

Namespace
Discord.Commands
Assembly
Discord.Net.Commands.dll

Provides extension methods for the CommandService class.

public static class CommandServiceExtensions
Inheritance
CommandServiceExtensions
Inherited Members

Methods

GetExecutableCommandsAsync(CommandService, ICommandContext, IServiceProvider)

Returns commands that can be executed under the current context.

public static Task<IReadOnlyCollection<CommandInfo>> GetExecutableCommandsAsync(this CommandService commandService, ICommandContext context, IServiceProvider provider)

Parameters

commandService CommandService

The desired command service class to check against.

context ICommandContext

The current command context.

provider IServiceProvider

The service provider used for dependency injection upon precondition check.

Returns

Task<IReadOnlyCollection<CommandInfo>>

A read-only collection of commands that can be executed under the current context.

GetExecutableCommandsAsync(ModuleInfo, ICommandContext, IServiceProvider)

Returns commands that can be executed under the current context.

public static Task<IReadOnlyCollection<CommandInfo>> GetExecutableCommandsAsync(this ModuleInfo module, ICommandContext context, IServiceProvider provider)

Parameters

module ModuleInfo

The module to be checked against.

context ICommandContext

The current command context.

provider IServiceProvider

The service provider used for dependency injection upon precondition check.

Returns

Task<IReadOnlyCollection<CommandInfo>>

A read-only collection of commands that can be executed under the current context.

GetExecutableCommandsAsync(ICollection<CommandInfo>, ICommandContext, IServiceProvider)

Returns commands that can be executed under the current context.

public static Task<IReadOnlyCollection<CommandInfo>> GetExecutableCommandsAsync(this ICollection<CommandInfo> commands, ICommandContext context, IServiceProvider provider)

Parameters

commands ICollection<CommandInfo>

The set of commands to be checked against.

context ICommandContext

The current command context.

provider IServiceProvider

The service provider used for dependency injection upon precondition check.

Returns

Task<IReadOnlyCollection<CommandInfo>>

A read-only collection of commands that can be executed under the current context.