Table of Contents

Class SlashCommandProcessor

Namespace
DSharpPlus.Commands.Processors.SlashCommands
Assembly
DSharpPlus.Commands.dll
public sealed class SlashCommandProcessor : BaseCommandProcessor<InteractionCreatedEventArgs, ISlashArgumentConverter, InteractionConverterContext, SlashCommandContext>, ICommandProcessor<InteractionCreatedEventArgs>, ICommandProcessor
Inheritance
SlashCommandProcessor
Implements
Inherited Members

Constructors

SlashCommandProcessor()

Creates a new instance of SlashCommandProcessor.

SlashCommandProcessor(SlashCommandConfiguration)

Creates a new instance of SlashCommandProcessor.

Fields

RequiredIntents

Properties

ApplicationCommandMapping
Commands

List of commands which are registered to this processor

Configuration

The configuration values being used for this processor.

TypeMappings

Methods

AddApplicationCommands(params DiscordApplicationCommand[])
AddApplicationCommands(IEnumerable<DiscordApplicationCommand>)
ClearDiscordSlashCommandsAsync(bool)
ConfigureAsync(CommandsExtension)

This method is called on initial setup and when the extension is refreshed. Register your needed event handlers here but use a mechanism to track if the inital setup was already done and if this call is only a refresh

CreateCommandContext(InteractionConverterContext, InteractionCreatedEventArgs, Dictionary<CommandParameter, object?>)
ExecuteConverterAsync<T>(ISlashArgumentConverter, InteractionConverterContext, InteractionCreatedEventArgs)

Executes an argument converter on the specified context.

ExecuteInteractionAsync(DiscordClient, InteractionCreatedEventArgs)
MapApplicationCommands(IReadOnlyList<DiscordApplicationCommand>)

Matches the application commands to the commands in the command tree.

ParseArgumentsAsync(InteractionConverterContext, InteractionCreatedEventArgs)

Parses the arguments provided to the command and returns a prepared command context.

RegisterSlashCommandsAsync(CommandsExtension)

Registers Commands as application commands. This will registers regardless of RegisterCommands's value.

ToApplicationCommandAsync(Command)

Only use this for commands of type SlashCommand. It will cut out every subcommands which are considered to be not a SlashCommand

ToApplicationParameterAsync(Command)
TryFindCommand(DiscordInteraction, out Command?, out IEnumerable<DiscordInteractionDataOption>?)