Table of Contents

Class SlashCommandsExtension

Namespace
DSharpPlus.SlashCommands
Assembly
DSharpPlus.SlashCommands.dll

A class that handles slash commands for a client.

[Obsolete("DSharpPlus.SlashCommands is obsolete. Please consider using the new DSharpPlus.Commands extension instead.")]
public sealed class SlashCommandsExtension
Inheritance
object
SlashCommandsExtension

Properties

Client
RegisteredCommands

Gets a list of registered commands. The key is the guild id (null if global).

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

RefreshCommandsAsync()

Refreshes your commands, used for refreshing choice providers or applying commands registered after the ready event on the discord client. Should only be run on the slash command extension linked to shard 0 if sharding.

Not recommended and should be avoided since it can make slash commands be unresponsive for a while.

RegisterCommands(Assembly, ulong?)

Registers all command classes from a given assembly.

RegisterCommands(Type, ulong?)

Registers a command class.

RegisterCommands<T>(ulong?)

Registers a command class.

Events

AutocompleteErrored
AutocompleteExecuted
ContextMenuErrored

Fires when the execution of a context menu fails.

ContextMenuExecuted

Fire when the execution of a context menu is successful.

ContextMenuInvoked

Fired when a context menu has been received and is to be executed

SlashCommandErrored

Fires when the execution of a slash command fails.

SlashCommandExecuted

Fires when the execution of a slash command is successful.

SlashCommandInvoked

Fired when a slash command has been received and is to be executed