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(CancellationToken)
Cleans all global application commands.
caution
You normally don't need to execute it.
- CleanGuildCommandsAsync(CancellationToken)
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.
- RegisterEntryPointCommand(string?, List<InteractionContextType>?, List<ApplicationCommandIntegrationTypes>?, ApplicationCommandHandlerType?, Permissions?, DiscordApplicationCommandLocalization?, DiscordApplicationCommandLocalization?)
Registers a custom entry point command for the application's activity.
Only one entry point command can exist per application. The name is always "launch" as required by Discord.
Use this to configure the description, allowed contexts, integration types, and handler type of the entry point command.
- 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.
- ContextMenuChecksFailed
Fires when context menu execution is aborted because one or more pre-execution checks failed.
- 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.
- SlashCommandChecksFailed
Fires when slash command execution is aborted because one or more pre-execution checks failed.
- SlashCommandErrored
Fires when the execution of a slash command fails.
- SlashCommandExecuted
Fires when the execution of a slash command is successful.