Class SelectionMenuEvent
- java.lang.Object
-
- net.dv8tion.jda.api.events.Event
-
- net.dv8tion.jda.api.events.interaction.GenericInteractionCreateEvent
-
- net.dv8tion.jda.api.events.interaction.GenericComponentInteractionCreateEvent
-
- net.dv8tion.jda.api.events.interaction.SelectionMenuEvent
-
- All Implemented Interfaces:
ISnowflake
,GenericEvent
,ComponentInteraction
,SelectionMenuInteraction
,Interaction
public class SelectionMenuEvent extends GenericComponentInteractionCreateEvent implements SelectionMenuInteraction
Indicates that a customSelectionMenu
on one of the bots messages was used by a user.This fires when a user selects the options on one of the custom selection menus attached to a bot or webhook message.
Requirements
To receive these events, you must unset the Interactions Endpoint URL in your application dashboard. You can simply remove the URL for this endpoint in your settings at the Discord Developers Portal.
-
-
Constructor Summary
Constructors Constructor Description SelectionMenuEvent(JDA api, long responseNumber, SelectionMenuInteraction interaction)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SelectionMenu
getComponent()
TheComponent
instance.SelectionMenuInteraction
getInteraction()
TheInteraction
instance.java.util.List<java.lang.String>
getValues()
The selected values.-
Methods inherited from class net.dv8tion.jda.api.events.interaction.GenericComponentInteractionCreateEvent
deferEdit, getChannel, getComponentId, getComponentType, getMessage, getMessageIdLong
-
Methods inherited from class net.dv8tion.jda.api.events.interaction.GenericInteractionCreateEvent
deferReply, getGuild, getHook, getIdLong, getMember, getToken, getTypeRaw, getUser, isAcknowledged
-
Methods inherited from class net.dv8tion.jda.api.events.Event
getJDA, getResponseNumber
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.dv8tion.jda.api.interactions.components.ComponentInteraction
deferEdit, editComponents, editComponents, editMessage, editMessage, editMessageEmbeds, editMessageEmbeds, editMessageFormat, getChannel, getComponentId, getComponentType, getMessage, getMessageId, getMessageIdLong
-
Methods inherited from interface net.dv8tion.jda.api.interactions.Interaction
deferReply, deferReply, getChannelType, getGuild, getGuildChannel, getHook, getJDA, getMember, getMessageChannel, getPrivateChannel, getTextChannel, getToken, getType, getTypeRaw, getUser, getVoiceChannel, isAcknowledged, isFromGuild, reply, reply, replyEmbeds, replyEmbeds, replyFormat
-
Methods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getIdLong, getTimeCreated
-
Methods inherited from interface net.dv8tion.jda.api.interactions.components.selections.SelectionMenuInteraction
editSelectionMenu, getSelectedOptions, getSelectionMenu
-
-
-
-
Constructor Detail
-
SelectionMenuEvent
public SelectionMenuEvent(@Nonnull JDA api, long responseNumber, @Nonnull SelectionMenuInteraction interaction)
-
-
Method Detail
-
getInteraction
@Nonnull public SelectionMenuInteraction getInteraction()
Description copied from class:GenericInteractionCreateEvent
TheInteraction
instance.
Note that this event is a delegate which implements the same interface.- Overrides:
getInteraction
in classGenericComponentInteractionCreateEvent
- Returns:
- The
Interaction
-
getComponent
@Nullable public SelectionMenu getComponent()
Description copied from interface:ComponentInteraction
TheComponent
instance.
This is null on interactions for ephemeral messages.- Specified by:
getComponent
in interfaceComponentInteraction
- Specified by:
getComponent
in interfaceSelectionMenuInteraction
- Overrides:
getComponent
in classGenericComponentInteractionCreateEvent
- Returns:
- The
Component
, or null if this message is ephemeral
-
getValues
@Nonnull public java.util.List<java.lang.String> getValues()
Description copied from interface:SelectionMenuInteraction
The selected values. These are defined in the individualSelectOptions
.- Specified by:
getValues
in interfaceSelectionMenuInteraction
- Returns:
List
ofSelectOption.getValue()
-
-