Table of Contents

Method RegisterGlobalCommands

Namespace
DisCatSharp.ApplicationCommands
Assembly
DisCatSharp.ApplicationCommands.dll

RegisterGlobalCommands(Assembly)

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

public void RegisterGlobalCommands(Assembly assembly)

Parameters

assembly Assembly

Assembly to register commands from.

RegisterGlobalCommands<T>(Action<ApplicationCommandsTranslationContext>?)

Registers a command class with optional translation setup globally.

public void RegisterGlobalCommands<T>(Action<ApplicationCommandsTranslationContext>? translationSetup = null) where T : ApplicationCommandsModule

Parameters

translationSetup Action<ApplicationCommandsTranslationContext>

A callback to setup translations with.

Type Parameters

T

The command class to register.

RegisterGlobalCommands(Type, Action<ApplicationCommandsTranslationContext>?)

Registers a command class with optional translation setup globally.

public void RegisterGlobalCommands(Type type, Action<ApplicationCommandsTranslationContext>? translationSetup = null)

Parameters

type Type

The Type of the command class to register.

translationSetup Action<ApplicationCommandsTranslationContext>

A callback to setup translations with.