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
configuration
ApplicationCommandServiceConfiguration<TContext>
Methods
AddMessageCommand(string, Delegate, Permissions?, bool?, bool, IEnumerable<ApplicationIntegrationType>?, IEnumerable<InteractionContextType>?, bool, ulong?)
public void AddMessageCommand(string name, Delegate handler, Permissions? defaultGuildUserPermissions = null, bool? dMPermission = null, bool defaultPermission = true, IEnumerable<ApplicationIntegrationType>? integrationTypes = null, IEnumerable<InteractionContextType>? contexts = null, bool nsfw = false, ulong? guildId = null)
Parameters
name
string
handler
Delegate
defaultGuildUserPermissions
Permissions?
dMPermission
bool?
defaultPermission
bool
integrationTypes
IEnumerable<ApplicationIntegrationType>
contexts
IEnumerable<InteractionContextType>
nsfw
bool
guildId
ulong?
AddModule(Type)
public void AddModule(Type type)
Parameters
type
Type
AddModule<T>()
public void AddModule<T>()
Type Parameters
T
AddModules(Assembly)
public void AddModules(Assembly assembly)
Parameters
assembly
Assembly
AddSlashCommand(string, string, Delegate, Permissions?, bool?, bool, IEnumerable<ApplicationIntegrationType>?, IEnumerable<InteractionContextType>?, bool, ulong?)
public void AddSlashCommand(string name, string description, Delegate handler, Permissions? defaultGuildUserPermissions = null, bool? dMPermission = null, bool defaultPermission = true, IEnumerable<ApplicationIntegrationType>? integrationTypes = null, IEnumerable<InteractionContextType>? contexts = null, bool nsfw = false, ulong? guildId = null)
Parameters
name
string
description
string
handler
Delegate
defaultGuildUserPermissions
Permissions?
dMPermission
bool?
defaultPermission
bool
integrationTypes
IEnumerable<ApplicationIntegrationType>
contexts
IEnumerable<InteractionContextType>
nsfw
bool
guildId
ulong?
AddUserCommand(string, Delegate, Permissions?, bool?, bool, IEnumerable<ApplicationIntegrationType>?, IEnumerable<InteractionContextType>?, bool, ulong?)
public void AddUserCommand(string name, Delegate handler, Permissions? defaultGuildUserPermissions = null, bool? dMPermission = null, bool defaultPermission = true, IEnumerable<ApplicationIntegrationType>? integrationTypes = null, IEnumerable<InteractionContextType>? contexts = null, bool nsfw = false, ulong? guildId = null)
Parameters
name
string
handler
Delegate
defaultGuildUserPermissions
Permissions?
dMPermission
bool?
defaultPermission
bool
integrationTypes
IEnumerable<ApplicationIntegrationType>
contexts
IEnumerable<InteractionContextType>
nsfw
bool
guildId
ulong?
CreateCommandsAsync(RestClient, ulong, bool, RestRequestProperties?, CancellationToken)
public Task<IReadOnlyList<ApplicationCommand>> CreateCommandsAsync(RestClient client, ulong applicationId, bool includeGuildCommands = false, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
client
RestClient
applicationId
ulong
includeGuildCommands
bool
properties
RestRequestProperties
cancellationToken
CancellationToken
Returns
- Task<IReadOnlyList<ApplicationCommand>>
ExecuteAsync(TContext, IServiceProvider?)
public ValueTask<IExecutionResult> ExecuteAsync(TContext context, IServiceProvider? serviceProvider = null)
Parameters
context
TContext
serviceProvider
IServiceProvider
Returns
- ValueTask<IExecutionResult>
GetCommands()
public IReadOnlyDictionary<ulong, ApplicationCommandInfo<TContext>> GetCommands()
Returns
- IReadOnlyDictionary<ulong, ApplicationCommandInfo<TContext>>