Table of Contents

Class ApplicationCommandServiceManager

Namespace
NetCord.Services.ApplicationCommands
Assembly
NetCord.Services.dll

Allows registration of application commands from multiple instances of ApplicationCommandService<TContext>.

public class ApplicationCommandServiceManager
Inheritance
ApplicationCommandServiceManager
Inherited Members

Constructors

ApplicationCommandServiceManager()

Allows registration of application commands from multiple instances of ApplicationCommandService<TContext>.

public ApplicationCommandServiceManager()

Properties

Services

The application command services added to the manager.

public IReadOnlyList<IApplicationCommandService> Services { get; }

Property Value

IReadOnlyList<IApplicationCommandService>

Methods

AddService(IApplicationCommandService)

Adds an application command service to the manager.

public void AddService(IApplicationCommandService service)

Parameters

service IApplicationCommandService

The application command service to add.

RegisterCommandsAsync(RestClient, ulong, ulong?, RestRequestProperties?, CancellationToken)

Registers the application commands to Discord.

public Task<IReadOnlyList<ApplicationCommand>> RegisterCommandsAsync(RestClient client, ulong applicationId, ulong? guildId = null, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

client RestClient

The RestClient to use for registration.

applicationId ulong

The application ID.

guildId ulong?

The guild ID for guild-specific commands, or null for global commands.

properties RestRequestProperties

The RestClient's request properties to use for registration.

cancellationToken CancellationToken

The cancellation token to cancel the operation.

Returns

Task<IReadOnlyList<ApplicationCommand>>

A task representing the registered application commands.