Table of Contents

Interface IApplicationCommandService

Namespace
NetCord.Services.ApplicationCommands
Assembly
NetCord.Services.dll
public interface IApplicationCommandService : IService
Inherited Members

Methods

AddEntryPointCommand(EntryPointCommandBuilder)

Adds an entry point command to the service.

void AddEntryPointCommand(EntryPointCommandBuilder builder)

Parameters

builder EntryPointCommandBuilder

The entry point command builder.

AddMessageCommand(MessageCommandBuilder)

Adds a message command to the service.

void AddMessageCommand(MessageCommandBuilder builder)

Parameters

builder MessageCommandBuilder

The message command builder.

AddModule(Type)

Adds a module to the service.

void AddModule(Type type)

Parameters

type Type

The type of the module to add.

AddModule<T>()

Adds a module to the service.

void AddModule<T>()

Type Parameters

T

The type of the module to add.

AddSlashCommand(SlashCommandBuilder)

Adds a slash command to the service.

void AddSlashCommand(SlashCommandBuilder builder)

Parameters

builder SlashCommandBuilder

The slash command builder.

AddSlashCommandGroup(SlashCommandGroupBuilder)

Adds a slash command group to the service.

void AddSlashCommandGroup(SlashCommandGroupBuilder builder)

Parameters

builder SlashCommandGroupBuilder

The slash command group builder.

AddUserCommand(UserCommandBuilder)

Adds a user command to the service.

void AddUserCommand(UserCommandBuilder builder)

Parameters

builder UserCommandBuilder

The user command builder.

GetCommands()

Gets the list of application commands registered in the service.

IReadOnlyList<IApplicationCommandInfo> GetCommands()

Returns

IReadOnlyList<IApplicationCommandInfo>

The list of application commands registered in the service.

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

Registers the application commands to Discord.

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.