Table of Contents

Class SlashCommandProcessor

Namespace
DSharpPlus.Commands.Processors.SlashCommands
Assembly
DSharpPlus.Commands.dll
public sealed class SlashCommandProcessor : BaseCommandProcessor<ISlashArgumentConverter, InteractionConverterContext, SlashCommandContext>, 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

The mapping of application command ids to Command objects.

Commands

List of commands which are registered to this processor

Configuration

The configuration values being used for this processor.

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, IReadOnlyDictionary<CommandParameter, object?>)

Constructs a command context from the parsed arguments and the current state of the ConverterContext.

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

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

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 IReadOnlyList<DiscordInteractionDataOption>?)