Class CommandsNextExtension
- Namespace
- DisCatSharp.CommandsNext
- Assembly
- DisCatSharp.CommandsNext.dll
This is the class which handles command registration, management, and execution.
public class CommandsNextExtension : BaseExtension
- Inheritance
-
CommandsNextExtension
- Inherited Members
Properties
- RegisteredCommands
Gets a dictionary of registered top-level commands.
- Services
Gets the service provider this CommandsNext module was configured with.
Methods
- ConvertArgument(string, CommandContext, Type)
Converts a string to specified type.
- ConvertArgument<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.
- 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[])
Unregister specified commands from CommandsNext.
- UnregisterConverter<T>()
Unregister an argument converter for specified type.
Events
- CommandErrored
Triggered whenever a command throws an exception during execution.
- CommandExecuted
Triggered whenever a command executes successfully.