Table of Contents

Class ApplicationCommandsExtension

Namespace
DisCatSharp.ApplicationCommands
Assembly
DisCatSharp.ApplicationCommands.dll

A class that handles slash commands for a client.

public sealed class ApplicationCommandsExtension : BaseExtension
Inheritance
ApplicationCommandsExtension
Inherited Members

Properties

FinishFired

Gets whether the finish event was fired.

GlobalCommands

Gets a list of registered global commands.

GuildCommands

Gets a list of registered guild commands mapped by guild id.

RegisteredCommands

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

Services

Gets the service provider this module was configured with.

Methods

CleanGlobalCommandsAsync()

Cleans all global application commands.

caution

You normally don't need to execute it.

CleanGuildCommandsAsync()

Cleans all guild application commands.

caution

You normally don't need to execute it.

CleanModule()

Cleans the module for a new start of the bot. DO NOT USE IF YOU DON'T KNOW WHAT IT DOES.

RegisterGlobalCommands(Assembly)

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

RegisterGlobalCommands(Type, Action<ApplicationCommandsTranslationContext>?)

Registers a command class with optional translation setup globally.

RegisterGlobalCommands<T>(Action<ApplicationCommandsTranslationContext>?)

Registers a command class with optional translation setup globally.

RegisterGuildCommands(Assembly, ulong)

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

RegisterGuildCommands(Type, ulong, Action<ApplicationCommandsTranslationContext>?)

Registers a command class with optional translation setup for a guild.

RegisterGuildCommands<T>(ulong, Action<ApplicationCommandsTranslationContext>?)

Registers a command class with optional translation setup for a guild.

Setup(DiscordClient)

Runs setup.

caution

DO NOT RUN THIS MANUALLY. DO NOT DO ANYTHING WITH THIS.

Events

ApplicationCommandsModuleReady

Fired when the application commands module is ready.

ApplicationCommandsModuleStartupFinished

Fired when the application commands modules startup is finished.

ContextMenuErrored

Fires when the execution of a context menu fails.

ContextMenuExecuted

Fire when the execution of a context menu is successful.

GlobalApplicationCommandsRegistered

Fired when the global commands are registered.

GuildApplicationCommandsRegistered

Fired when guild commands are registered on a guild.

SlashCommandErrored

Fires when the execution of a slash command fails.

SlashCommandExecuted

Fires when the execution of a slash command is successful.