Interface IApplicationCommandService
- Namespace
- NetCord.Services.ApplicationCommands
- Assembly
- NetCord.Services.dll
Base interface for ApplicationCommandService<TContext>.
public interface IApplicationCommandService : IService
- Inherited Members
Methods
AddEntryPointCommand(EntryPointCommandBuilder)
Adds an entry point command to the service.
void AddEntryPointCommand(EntryPointCommandBuilder builder)
Parameters
builderEntryPointCommandBuilderThe entry point command builder.
AddMessageCommand(MessageCommandBuilder)
Adds a message command to the service.
void AddMessageCommand(MessageCommandBuilder builder)
Parameters
builderMessageCommandBuilderThe message command builder.
AddModule(Type)
Adds a module to the service.
void AddModule(Type type)
Parameters
typeTypeThe type of the module to add.
AddModule<T>()
Adds a module to the service.
void AddModule<T>()
Type Parameters
TThe type of the module to add.
AddSlashCommand(SlashCommandBuilder)
Adds a slash command to the service.
void AddSlashCommand(SlashCommandBuilder builder)
Parameters
builderSlashCommandBuilderThe slash command builder.
AddSlashCommandGroup(SlashCommandGroupBuilder)
Adds a slash command group to the service.
void AddSlashCommandGroup(SlashCommandGroupBuilder builder)
Parameters
builderSlashCommandGroupBuilderThe slash command group builder.
AddUserCommand(UserCommandBuilder)
Adds a user command to the service.
void AddUserCommand(UserCommandBuilder builder)
Parameters
builderUserCommandBuilderThe 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
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.