Table of Contents

Class CommandsNextExtension

Namespace
DSharpPlus.CommandsNext
Assembly
DSharpPlus.CommandsNext.dll

This is the class which handles command registration, management, and execution.

public class CommandsNextExtension
Inheritance
object
CommandsNextExtension

Properties

Client
RegisteredCommands

Gets a dictionary of registered top-level commands.

Services

Gets the service provider this CommandsNext module was configured with.

Methods

ConvertArgumentAsync(string?, CommandContext, Type)

Converts a string to specified type.

ConvertArgumentAsync<T>(string, CommandContext)

Converts a string to specified type.

CreateContext(DiscordMessage, string, Command?, string?)

Creates a command execution context from specified arguments.

CreateFakeContext(DiscordUser, DiscordChannel, string, string, Command, string?)

Creates a fake command context to execute commands with.

Dispose()

Disposes of this the resources used by CNext.

ExecuteCommandAsync(CommandContext)

Executes specified command from given context.

FindCommand(string, out string?)

Finds a specified command by its qualified name, then separates arguments.

GetUserFriendlyTypeName(Type)

Converts a type into user-friendly type name.

RegisterCommands(params CommandBuilder[])

Builds and registers all supplied commands.

RegisterCommands(Assembly)

Registers all commands from a given assembly. The command classes need to be public to be considered for registration.

RegisterCommands(Type)

Registers all commands from a given command class.

RegisterCommands<T>()

Registers all commands from a given command class.

RegisterConverter<T>(IArgumentConverter<T>)

Registers an argument converter for specified type.

RegisterUserFriendlyTypeName<T>(string)

Registers a user-friendly type name.

SetHelpFormatter<T>()

Sets the help formatter to use with the default help command.

Setup(DiscordClient)

DO NOT USE THIS MANUALLY.

UnregisterCommands(params Command[])

Unregisters specified commands from CommandsNext.

UnregisterConverter<T>()

Unregisters an argument converter for specified type.

Events

CommandErrored

Triggered whenever a command throws an exception during execution.

CommandExecuted

Triggered whenever a command executes successfully.