Table of Contents

Method RegisterGuildCommands

Namespace
DisCatSharp.ApplicationCommands
Assembly
DisCatSharp.ApplicationCommands.dll

RegisterGuildCommands(Assembly, ulong)

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

public void RegisterGuildCommands(Assembly assembly, ulong guildId)

Parameters

assembly Assembly

Assembly to register commands from.

guildId ulong

The guild id to register it on.

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

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

public void RegisterGuildCommands<T>(ulong guildId, Action<ApplicationCommandsTranslationContext>? translationSetup = null) where T : ApplicationCommandsModule

Parameters

guildId ulong

The guild id to register it on.

translationSetup Action<ApplicationCommandsTranslationContext>

A callback to setup translations with.

Type Parameters

T

The command class to register.

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

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

public void RegisterGuildCommands(Type type, ulong guildId, Action<ApplicationCommandsTranslationContext>? translationSetup = null)

Parameters

type Type

The Type of the command class to register.

guildId ulong

The guild id to register it on.

translationSetup Action<ApplicationCommandsTranslationContext>

A callback to setup translations with.