Table of Contents

Class ExtensionMethods

Namespace
DisCatSharp.ApplicationCommands
Assembly
DisCatSharp.ApplicationCommands.dll

Defines various extension methods for application commands.

public static class ExtensionMethods
Inheritance
ExtensionMethods
Inherited Members

Methods

GetApplicationCommands(DiscordClient)

Gets the application commands module for this client.

GetApplicationCommandsAsync(DiscordShardedClient)

Gets the application commands from this DiscordShardedClient.

GetName<T>(T)

Gets the name from the ChoiceNameAttribute for this enum value.

RegisterEntryPointCommand(IReadOnlyDictionary<int, ApplicationCommandsExtension>, string?, List<InteractionContextType>?, List<ApplicationCommandIntegrationTypes>?, ApplicationCommandHandlerType?, Permissions?, DiscordApplicationCommandLocalization?, DiscordApplicationCommandLocalization?)

Registers an entry point command across all shards.

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(IReadOnlyDictionary<int, ApplicationCommandsExtension>, Type, Action<ApplicationCommandsTranslationContext>?)

Registers a command class with optional translation setup globally.

RegisterGlobalCommands<T>(IReadOnlyDictionary<int, ApplicationCommandsExtension>, Action<ApplicationCommandsTranslationContext>?)

Registers a command class with optional translation setup globally.

RegisterGuildCommands(IReadOnlyDictionary<int, ApplicationCommandsExtension>, Type, ulong, Action<ApplicationCommandsTranslationContext>)

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

RegisterGuildCommands<T>(IReadOnlyDictionary<int, ApplicationCommandsExtension>, ulong, Action<ApplicationCommandsTranslationContext>?)

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

UseApplicationCommands(DiscordClient, ApplicationCommandsConfiguration?)

Enables application commands on this DiscordClient.

UseApplicationCommandsAsync(DiscordShardedClient, ApplicationCommandsConfiguration?)

Enables application commands on this DiscordShardedClient.