Package xyz.dynxsty.dih4jda
Class InteractionHandler
java.lang.Object
net.dv8tion.jda.api.hooks.ListenerAdapter
xyz.dynxsty.dih4jda.InteractionHandler
- All Implemented Interfaces:
net.dv8tion.jda.api.hooks.EventListener
public class InteractionHandler
extends net.dv8tion.jda.api.hooks.ListenerAdapter
The Handler class, that finds, registers and handles all Commands and other Interactions.
-
Method Summary
Modifier and TypeMethodDescriptionvoidonButtonInteraction(net.dv8tion.jda.api.events.interaction.component.ButtonInteractionEvent event) Fired if Discord reports aButtonInteractionEvent.voidonCommandAutoCompleteInteraction(net.dv8tion.jda.api.events.interaction.command.CommandAutoCompleteInteractionEvent event) Fired if Discord reports aCommandAutoCompleteInteractionEvent.voidonEntitySelectInteraction(net.dv8tion.jda.api.events.interaction.component.EntitySelectInteractionEvent event) voidonMessageContextInteraction(net.dv8tion.jda.api.events.interaction.command.MessageContextInteractionEvent event) Fired if Discord reports aMessageContextInteractionEvent.voidonModalInteraction(net.dv8tion.jda.api.events.interaction.ModalInteractionEvent event) Fired if Discord reports aModalInteractionEvent.voidonSlashCommandInteraction(net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent event) Fired if Discord reports aSlashCommandInteractionEvent.voidonStringSelectInteraction(net.dv8tion.jda.api.events.interaction.component.StringSelectInteractionEvent event) Fired if Discord reports aStringSelectInteractionEvent.voidonUserContextInteraction(net.dv8tion.jda.api.events.interaction.command.UserContextInteractionEvent event) Fired if Discord reports aUserContextInteractionEvent.voidRegisters all interactions.Methods inherited from class net.dv8tion.jda.api.hooks.ListenerAdapter
onApplicationCommandUpdatePrivileges, onApplicationUpdatePrivileges, onChannelCreate, onChannelDelete, onChannelUpdateAppliedTags, onChannelUpdateArchived, onChannelUpdateArchiveTimestamp, onChannelUpdateAutoArchiveDuration, onChannelUpdateBitrate, onChannelUpdateDefaultReaction, onChannelUpdateDefaultThreadSlowmode, onChannelUpdateFlags, onChannelUpdateInvitable, onChannelUpdateLocked, onChannelUpdateName, onChannelUpdateNSFW, onChannelUpdateParent, onChannelUpdatePosition, onChannelUpdateRegion, onChannelUpdateSlowmode, onChannelUpdateTopic, onChannelUpdateType, onChannelUpdateUserLimit, onEmojiAdded, onEmojiRemoved, onEmojiUpdateName, onEmojiUpdateRoles, onEvent, onException, onForumTagAdd, onForumTagRemove, onForumTagUpdateEmoji, onForumTagUpdateModerated, onForumTagUpdateName, onGatewayPing, onGenericAutoCompleteInteraction, onGenericChannel, onGenericChannelUpdate, onGenericCommandInteraction, onGenericComponentInteractionCreate, onGenericContextInteraction, onGenericEmoji, onGenericEmojiUpdate, onGenericEvent, onGenericForumTag, onGenericForumTagUpdate, onGenericGuild, onGenericGuildInvite, onGenericGuildMember, onGenericGuildMemberUpdate, onGenericGuildSticker, onGenericGuildStickerUpdate, onGenericGuildUpdate, onGenericGuildVoice, onGenericInteractionCreate, onGenericMessage, onGenericMessageReaction, onGenericPermissionOverride, onGenericPrivilegeUpdate, onGenericRole, onGenericRoleUpdate, onGenericScheduledEventUpdate, onGenericSelectMenuInteraction, onGenericSelfUpdate, onGenericSessionEvent, onGenericStageInstance, onGenericStageInstanceUpdate, onGenericThread, onGenericThreadMember, onGenericUpdate, onGenericUser, onGenericUserPresence, onGuildAvailable, onGuildBan, onGuildInviteCreate, onGuildInviteDelete, onGuildJoin, onGuildLeave, onGuildMemberJoin, onGuildMemberRemove, onGuildMemberRoleAdd, onGuildMemberRoleRemove, onGuildMemberUpdate, onGuildMemberUpdateAvatar, onGuildMemberUpdateBoostTime, onGuildMemberUpdateNickname, onGuildMemberUpdatePending, onGuildMemberUpdateTimeOut, onGuildReady, onGuildStickerAdded, onGuildStickerRemoved, onGuildStickerUpdateAvailable, onGuildStickerUpdateDescription, onGuildStickerUpdateName, onGuildStickerUpdateTags, onGuildTimeout, onGuildUnavailable, onGuildUnban, onGuildUpdateAfkChannel, onGuildUpdateAfkTimeout, onGuildUpdateBanner, onGuildUpdateBoostCount, onGuildUpdateBoostTier, onGuildUpdateCommunityUpdatesChannel, onGuildUpdateDescription, onGuildUpdateExplicitContentLevel, onGuildUpdateFeatures, onGuildUpdateIcon, onGuildUpdateLocale, onGuildUpdateMaxMembers, onGuildUpdateMaxPresences, onGuildUpdateMFALevel, onGuildUpdateName, onGuildUpdateNotificationLevel, onGuildUpdateNSFWLevel, onGuildUpdateOwner, onGuildUpdateRulesChannel, onGuildUpdateSplash, onGuildUpdateSystemChannel, onGuildUpdateVanityCode, onGuildUpdateVerificationLevel, onGuildVoiceDeafen, onGuildVoiceGuildDeafen, onGuildVoiceGuildMute, onGuildVoiceMute, onGuildVoiceRequestToSpeak, onGuildVoiceSelfDeafen, onGuildVoiceSelfMute, onGuildVoiceStream, onGuildVoiceSuppress, onGuildVoiceUpdate, onGuildVoiceVideo, onHttpRequest, onMessageBulkDelete, onMessageDelete, onMessageEmbed, onMessageReactionAdd, onMessageReactionRemove, onMessageReactionRemoveAll, onMessageReactionRemoveEmoji, onMessageReceived, onMessageUpdate, onPermissionOverrideCreate, onPermissionOverrideDelete, onPermissionOverrideUpdate, onRawGateway, onReady, onRoleCreate, onRoleDelete, onRoleUpdateColor, onRoleUpdateHoisted, onRoleUpdateIcon, onRoleUpdateMentionable, onRoleUpdateName, onRoleUpdatePermissions, onRoleUpdatePosition, onScheduledEventCreate, onScheduledEventDelete, onScheduledEventUpdateDescription, onScheduledEventUpdateEndTime, onScheduledEventUpdateLocation, onScheduledEventUpdateName, onScheduledEventUpdateStartTime, onScheduledEventUpdateStatus, onScheduledEventUserAdd, onScheduledEventUserRemove, onSelfUpdateAvatar, onSelfUpdateMFA, onSelfUpdateName, onSelfUpdateVerified, onSessionDisconnect, onSessionInvalidate, onSessionRecreate, onSessionResume, onShutdown, onStageInstanceCreate, onStageInstanceDelete, onStageInstanceUpdatePrivacyLevel, onStageInstanceUpdateTopic, onStatusChange, onThreadHidden, onThreadMemberJoin, onThreadMemberLeave, onThreadRevealed, onUnavailableGuildJoined, onUnavailableGuildLeave, onUserActivityEnd, onUserActivityStart, onUserTyping, onUserUpdateActivities, onUserUpdateActivityOrder, onUserUpdateAvatar, onUserUpdateDiscriminator, onUserUpdateFlags, onUserUpdateName, onUserUpdateOnlineStatus
-
Method Details
-
registerInteractions
Registers all interactions. This method can be accessed from theDIH4JDAinstance.
This is automatically executed each time theListenerAdapter.onReady(net.dv8tion.jda.api.events.session.ReadyEvent)event is executed. (can be disabled usingDIH4JDABuilder.disableAutomaticCommandRegistration())- Throws:
ReflectiveOperationException- If an error occurs.
-
onSlashCommandInteraction
public void onSlashCommandInteraction(@Nonnull net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent event) Fired if Discord reports aSlashCommandInteractionEvent.- Overrides:
onSlashCommandInteractionin classnet.dv8tion.jda.api.hooks.ListenerAdapter- Parameters:
event- TheSlashCommandInteractionEventthat was fired.
-
onUserContextInteraction
public void onUserContextInteraction(@Nonnull net.dv8tion.jda.api.events.interaction.command.UserContextInteractionEvent event) Fired if Discord reports aUserContextInteractionEvent.- Overrides:
onUserContextInteractionin classnet.dv8tion.jda.api.hooks.ListenerAdapter- Parameters:
event- TheUserContextInteractionEventthat was fired.
-
onMessageContextInteraction
public void onMessageContextInteraction(@Nonnull net.dv8tion.jda.api.events.interaction.command.MessageContextInteractionEvent event) Fired if Discord reports aMessageContextInteractionEvent.- Overrides:
onMessageContextInteractionin classnet.dv8tion.jda.api.hooks.ListenerAdapter- Parameters:
event- TheMessageContextInteractionEventthat was fired.
-
onCommandAutoCompleteInteraction
public void onCommandAutoCompleteInteraction(@Nonnull net.dv8tion.jda.api.events.interaction.command.CommandAutoCompleteInteractionEvent event) Fired if Discord reports aCommandAutoCompleteInteractionEvent.- Overrides:
onCommandAutoCompleteInteractionin classnet.dv8tion.jda.api.hooks.ListenerAdapter- Parameters:
event- TheCommandAutoCompleteInteractionEventthat was fired.
-
onButtonInteraction
public void onButtonInteraction(@Nonnull net.dv8tion.jda.api.events.interaction.component.ButtonInteractionEvent event) Fired if Discord reports aButtonInteractionEvent.- Overrides:
onButtonInteractionin classnet.dv8tion.jda.api.hooks.ListenerAdapter- Parameters:
event- TheButtonInteractionEventthat was fired.
-
onStringSelectInteraction
public void onStringSelectInteraction(@Nonnull net.dv8tion.jda.api.events.interaction.component.StringSelectInteractionEvent event) Fired if Discord reports aStringSelectInteractionEvent.- Overrides:
onStringSelectInteractionin classnet.dv8tion.jda.api.hooks.ListenerAdapter- Parameters:
event- TheStringSelectInteractionEventthat was fired.
-
onEntitySelectInteraction
public void onEntitySelectInteraction(@Nonnull net.dv8tion.jda.api.events.interaction.component.EntitySelectInteractionEvent event) - Overrides:
onEntitySelectInteractionin classnet.dv8tion.jda.api.hooks.ListenerAdapter
-
onModalInteraction
public void onModalInteraction(@Nonnull net.dv8tion.jda.api.events.interaction.ModalInteractionEvent event) Fired if Discord reports aModalInteractionEvent.- Overrides:
onModalInteractionin classnet.dv8tion.jda.api.hooks.ListenerAdapter- Parameters:
event- TheModalInteractionEventthat was fired.
-