Class ApplicationCommandService<TContext>
- Namespace
- NetCord.Services.ApplicationCommands
- Assembly
- NetCord.Services.dll
public class ApplicationCommandService<TContext> : IApplicationCommandService, IService where TContext : IApplicationCommandContext
Type Parameters
TContext
- Inheritance
-
ApplicationCommandService<TContext>
- Implements
- Derived
- Inherited Members
Constructors
ApplicationCommandService(ApplicationCommandServiceConfiguration<TContext>?)
public ApplicationCommandService(ApplicationCommandServiceConfiguration<TContext>? configuration = null)
Parameters
configurationApplicationCommandServiceConfiguration<TContext>
Properties
Configuration
public ApplicationCommandServiceConfiguration<TContext> Configuration { get; }
Property Value
- ApplicationCommandServiceConfiguration<TContext>
Methods
AddEntryPointCommand(EntryPointCommandBuilder)
public void AddEntryPointCommand(EntryPointCommandBuilder builder)
Parameters
builderEntryPointCommandBuilder
AddMessageCommand(MessageCommandBuilder)
public void AddMessageCommand(MessageCommandBuilder builder)
Parameters
builderMessageCommandBuilder
AddModule(Type)
public void AddModule(Type type)
Parameters
typeType
AddModule<T>()
public void AddModule<T>()
Type Parameters
T
AddModules(Assembly)
public void AddModules(Assembly assembly)
Parameters
assemblyAssembly
AddSlashCommand(SlashCommandBuilder)
public void AddSlashCommand(SlashCommandBuilder builder)
Parameters
builderSlashCommandBuilder
AddSlashCommandGroup(SlashCommandGroupBuilder)
public void AddSlashCommandGroup(SlashCommandGroupBuilder builder)
Parameters
builderSlashCommandGroupBuilder
AddUserCommand(UserCommandBuilder)
public void AddUserCommand(UserCommandBuilder builder)
Parameters
builderUserCommandBuilder
ExecuteAsync(TContext, IServiceProvider?)
public ValueTask<IExecutionResult> ExecuteAsync(TContext context, IServiceProvider? serviceProvider = null)
Parameters
contextTContextserviceProviderIServiceProvider
Returns
GetCommands()
public IReadOnlyList<ApplicationCommandInfo<TContext>> GetCommands()
Returns
- IReadOnlyList<ApplicationCommandInfo<TContext>>
RegisterCommandsAsync(RestClient, ulong, ulong?, RestRequestProperties?, CancellationToken)
public Task<IReadOnlyList<ApplicationCommand>> RegisterCommandsAsync(RestClient client, ulong applicationId, ulong? guildId = null, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
clientRestClientapplicationIdulongguildIdulong?propertiesRestRequestPropertiescancellationTokenCancellationToken