Table of Contents

Class CommandsExtension

Namespace
DSharpPlus.Commands
Assembly
DSharpPlus.Commands.dll

An all in one extension for managing commands.

public sealed class CommandsExtension
Inheritance
object
CommandsExtension

Properties

Checks
Client
CommandExecutor
Commands

The registered commands that the users can execute.

DebugGuildId

The guild id to use for debugging. Leave as 0 to disable.

ParameterChecks
Processors

All registered command processors.

RegisterDefaultCommandProcessors

Whether to register default command processors when they're not found in the processor list.

ServiceProvider

Gets the service provider used within this Discord application.

UseDefaultCommandErrorHandler

Whether to enable the default command error handler.

Methods

AddCheck(Type)

Adds a new check to the extension.

AddCheck<T>()

Adds a new check to the extension.

AddChecks(Assembly)

Adds all public checks from the provided assembly to the extension.

AddCommand(CommandBuilder)
AddCommand(Delegate)
AddCommand(Delegate, params ulong[])
AddCommand(Type)
AddCommand(Type, params ulong[])
AddCommands(params CommandBuilder[])
AddCommands(IEnumerable<CommandBuilder>)
AddCommands(IEnumerable<Type>)
AddCommands(IEnumerable<Type>, params ulong[])
AddCommands(Assembly)
AddCommands(Assembly, params ulong[])
AddCommands(Type)
AddCommands(Type, params ulong[])
AddCommands<T>()
AddCommands<T>(params ulong[])
AddParameterCheck(Type)

Adds a new check to the extension.

AddParameterCheck<T>()

Adds a new check to the extension.

AddParameterChecks(Assembly)

Adds all parameter checks from the provided assembly to the extension.

AddProcessor(ICommandProcessor)
AddProcessor<TProcessor>()
AddProcessors(params ICommandProcessor[])
AddProcessors(IEnumerable<ICommandProcessor>)
GetCommandsForProcessor(ICommandProcessor)

Gets a list of commands filtered for a specific command processor

GetProcessor<TProcessor>()
RefreshAsync()
Setup(DiscordClient)

Sets up the extension to use the specified DiscordClient.

TryGetProcessor<TProcessor>(out TProcessor?)

Events

CommandErrored

Executed everytime a command has errored.

CommandExecuted

Executed everytime a command is finished executing.

ConfiguringCommands

Executed before commands are finalized into a read-only state.