Class ComponentInteractionHandler
Handles all incoming component interactions requests.
Inheritance
Implements
Inherited Members
Namespace: Color_Chan.Discord.Commands.Services.Implementations.InteractionHandlers
Assembly: Color-Chan.Discord.Commands.dll
Syntax
public class ComponentInteractionHandler : IComponentInteractionHandler
Constructors
| Improve this Doc View SourceComponentInteractionHandler(ILogger<ComponentInteractionHandler>, IServiceProvider, IComponentService, IOptions<ComponentInteractionConfiguration>, IDiscordRestGuild, IDiscordRestChannel, IDiscordRestApplication)
Initializes a new instance of ComponentInteractionHandler.
Declaration
public ComponentInteractionHandler(ILogger<ComponentInteractionHandler> logger, IServiceProvider serviceProvider, IComponentService componentService, IOptions<ComponentInteractionConfiguration> options, IDiscordRestGuild restGuild, IDiscordRestChannel restChannel, IDiscordRestApplication application)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Extensions.Logging.ILogger<ComponentInteractionHandler> | logger | The Microsoft.Extensions.Logging.ILogger for ComponentInteractionHandler. |
System.IServiceProvider | serviceProvider | The services needed to execute the component interactions. |
IComponentService | componentService | The IComponentService used to search and execute the correct components. |
Microsoft.Extensions.Options.IOptions<ComponentInteractionConfiguration> | options | The ComponentInteractionConfiguration containing the configuration data for component interactions. |
IDiscordRestGuild | restGuild | The rest class for Guilds. |
IDiscordRestChannel | restChannel | The rest class for Channels. |
IDiscordRestApplication | application | The rest class the Application calls. |
Methods
| Improve this Doc View SourceHandleComponentInteractionAsync(IDiscordInteraction)
Handles a component interaction request.
Declaration
public async Task<InternalInteractionResponse> HandleComponentInteractionAsync(IDiscordInteraction interaction)
Parameters
Type | Name | Description |
---|---|---|
IDiscordInteraction | interaction | The IDiscordInteraction that was requested. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<InternalInteractionResponse> | A InternalInteractionResponse containing the result of the component interaction. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown when the Data is null. |
System.NullReferenceException | Thrown when no user or member was found. |
ComponentInteractionResultException | Thrown when no channel id was found. |