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
Methods
AddService(IApplicationCommandService)
Adds an application command service to the manager.
public void AddService(IApplicationCommandService service)
Parameters
serviceIApplicationCommandServiceThe 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
clientRestClientThe RestClient to use for registration.
applicationIdulongThe application ID.
guildIdulong?The guild ID for guild-specific commands, or null for global commands.
propertiesRestRequestPropertiesThe RestClient's request properties to use for registration.
cancellationTokenCancellationTokenThe cancellation token to cancel the operation.
Returns
- Task<IReadOnlyList<ApplicationCommand>>
A task representing the registered application commands.