Skip to content

Commit 76f916b

Browse files
committed
fix: Updated not being able to reply to modals with select menus because of a custom exception set
1 parent 4de4681 commit 76f916b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/java/com/seailz/jdaframework/modals/controller/ModalManager.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import net.dv8tion.jda.api.entities.Member;
66
import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent;
77
import net.dv8tion.jda.api.events.interaction.component.ButtonInteractionEvent;
8+
import net.dv8tion.jda.api.events.interaction.component.SelectMenuInteractionEvent;
89
import net.dv8tion.jda.api.interactions.Interaction;
910
import net.dv8tion.jda.api.interactions.components.ActionRow;
1011
import net.dv8tion.jda.api.interactions.components.ItemComponent;
@@ -49,8 +50,11 @@ public static void open(Modal modal, Member member, Interaction interaction) {
4950
} else if (interaction instanceof ButtonInteractionEvent) {
5051
ButtonInteractionEvent e = (ButtonInteractionEvent) interaction;
5152
e.replyModal(jdaModal.build()).queue();
53+
} else if (interaction instanceof SelectMenuInteractionEvent) {
54+
SelectMenuInteractionEvent e = (SelectMenuInteractionEvent) interaction;
55+
e.replyModal(jdaModal.build()).queue();
5256
} else
53-
throw new IllegalStateException("Interaction is not a SlashCommandInteractionEvent or ButtonInteractionEvent");
57+
throw new IllegalStateException("Interaction is not a SlashCommandInteractionEvent, SelectMenuInteractionEvent or ButtonInteractionEvent");
5458

5559

5660
modals.add(new Map.Entry<Member, Modal>() {

0 commit comments

Comments
 (0)