Class DiscordSlashCommandHandler
Handles all incoming slash command requests.
Inheritance
System.Object
DiscordSlashCommandHandler
Implements
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Color_Chan.Discord.Commands.Services.Implementations.InteractionHandlers
Assembly: Color-Chan.Discord.Commands.dll
Syntax
public class DiscordSlashCommandHandler : IDiscordSlashCommandHandler
Constructors
| Improve this Doc View SourceDiscordSlashCommandHandler(ISlashCommandService, IServiceProvider, ILogger<DiscordSlashCommandHandler>, IDiscordRestApplication, IDiscordRestGuild, IDiscordRestChannel, IOptions<SlashCommandConfiguration>)
Initializes a new instance of DiscordSlashCommandHandler.
Declaration
public DiscordSlashCommandHandler(ISlashCommandService slashCommandService, IServiceProvider serviceProvider, ILogger<DiscordSlashCommandHandler> logger, IDiscordRestApplication restApplication, IDiscordRestGuild restGuild, IDiscordRestChannel restChannel, IOptions<SlashCommandConfiguration> slashCommandConfiguration)
Parameters
Type | Name | Description |
---|---|---|
ISlashCommandService | slashCommandService | The ISlashCommandService that will execute the slash command. |
System.IServiceProvider | serviceProvider | The service provider. |
Microsoft.Extensions.Logging.ILogger<DiscordSlashCommandHandler> | logger | The logger. |
IDiscordRestApplication | restApplication | The rest class for application calls. |
IDiscordRestGuild | restGuild | The rest class for Guilds. |
IDiscordRestChannel | restChannel | The rest class for Channels. |
Microsoft.Extensions.Options.IOptions<SlashCommandConfiguration> | slashCommandConfiguration | The configuration class for slash commands. |
Methods
| Improve this Doc View SourceHandleSlashCommandAsync(IDiscordInteraction)
Handles a interaction slash command request.
Declaration
public async Task<InternalInteractionResponse> HandleSlashCommandAsync(IDiscordInteraction interaction)
Parameters
Type | Name | Description |
---|---|---|
IDiscordInteraction | interaction | The interaction that was used. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<InternalInteractionResponse> | A InternalInteractionResponse containing the result of the slash command. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown when Data is null. |