Table of Contents

Method RegisterGlobalCommands

Namespace
DisCatSharp.ApplicationCommands
Assembly
DisCatSharp.ApplicationCommands.dll

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

Registers a command class with optional translation setup globally.

public static void RegisterGlobalCommands<T>(this IReadOnlyDictionary<int, ApplicationCommandsExtension> extensions, Action<ApplicationCommandsTranslationContext>? translationSetup = null) where T : ApplicationCommandsModule

Parameters

extensions IReadOnlyDictionary<int, ApplicationCommandsExtension>

Sharding extensions.

translationSetup Action<ApplicationCommandsTranslationContext>

A callback to setup translations with.

Type Parameters

T

The command class to register.

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

Registers a command class with optional translation setup globally.

public static void RegisterGlobalCommands(this IReadOnlyDictionary<int, ApplicationCommandsExtension> extensions, Type type, Action<ApplicationCommandsTranslationContext>? translationSetup = null)

Parameters

extensions IReadOnlyDictionary<int, ApplicationCommandsExtension>

Sharding extensions.

type Type

The Type of the command class to register.

translationSetup Action<ApplicationCommandsTranslationContext>

A callback to setup translations with.