Interface SelectionMenuInteraction
-
- All Superinterfaces:
ComponentInteraction,Interaction,ISnowflake
- All Known Implementing Classes:
SelectionMenuEvent
public interface SelectionMenuInteraction extends ComponentInteraction
Component Interaction for aSelectionMenu.- See Also:
SelectionMenuEvent
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default RestAction<java.lang.Void>editSelectionMenu(SelectionMenu newMenu)Update the selection menu with a new selection menu instance.SelectionMenugetComponent()TheComponentinstance.default java.util.List<SelectOption>getSelectedOptions()If available, this will resolve the selectedvaluesto the representativeSelectOptioninstances.default SelectionMenugetSelectionMenu()TheSelectionMenuthis interaction belongs to.java.util.List<java.lang.String>getValues()The selected values.-
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
-
-
-
-
Method Detail
-
getComponent
@Nullable SelectionMenu getComponent()
Description copied from interface:ComponentInteractionTheComponentinstance.
This is null on interactions for ephemeral messages.- Specified by:
getComponentin interfaceComponentInteraction- Returns:
- The
Component, or null if this message is ephemeral
-
getSelectionMenu
@Nullable default SelectionMenu getSelectionMenu()
TheSelectionMenuthis interaction belongs to.
This is null for ephemeral messages!- Returns:
- The
SelectionMenu - See Also:
ComponentInteraction.getComponentId()
-
getSelectedOptions
@Nullable default java.util.List<SelectOption> getSelectedOptions()
If available, this will resolve the selectedvaluesto the representativeSelectOptioninstances.
This is null if the message is ephemeral.- Returns:
Listof the selected options or null if this message is ephemeral
-
getValues
@Nonnull java.util.List<java.lang.String> getValues()
The selected values. These are defined in the individualSelectOptions.- Returns:
ListofSelectOption.getValue()
-
editSelectionMenu
@Nonnull @CheckReturnValue default RestAction<java.lang.Void> editSelectionMenu(@Nullable SelectionMenu newMenu)
Update the selection menu with a new selection menu instance.If this interaction is already acknowledged this will use
Interaction.getHook()and otherwiseComponentInteraction.editComponents(Collection)directly to acknowledge the interaction.- Parameters:
newMenu- The new selection menu to use, or null to remove this menu from the message entirely- Returns:
RestAction- Throws:
java.lang.IllegalStateException- If this interaction was triggered by a selection menu on an ephemeral message.- See Also:
SelectionMenu.createCopy(),SelectionMenu.create(String)
-
-