44import lombok .extern .slf4j .Slf4j ;
55import net .dv8tion .jda .api .EmbedBuilder ;
66import net .dv8tion .jda .api .entities .*;
7- import net .dv8tion .jda .api .events .interaction .ButtonClickEvent ;
8- import net .dv8tion .jda .api .events .interaction .SelectionMenuEvent ;
7+ import net .dv8tion .jda .api .events .interaction .component . ButtonInteractionEvent ;
8+ import net .dv8tion .jda .api .events .interaction .component . SelectMenuInteractionEvent ;
99import net .dv8tion .jda .api .interactions .components .ActionRow ;
10- import net .dv8tion .jda .api .interactions .components .Button ;
11- import net .dv8tion .jda .api .interactions .components .selections .SelectionMenu ;
10+ import net .dv8tion .jda .api .interactions .components .buttons . Button ;
11+ import net .dv8tion .jda .api .interactions .components .selections .SelectMenu ;
1212import net .javadiscord .javabot .Bot ;
1313import net .javadiscord .javabot .command .Responses ;
1414import net .javadiscord .javabot .data .config .guild .QOTWConfig ;
@@ -68,9 +68,9 @@ private boolean hasPermissions(Member member) {
6868 * Handles Button interactions regarding the Submission Controls System.
6969 *
7070 * @param id The button's id, split by ":".
71- * @param event The {@link ButtonClickEvent } that is fired upon use.
71+ * @param event The {@link ButtonInteractionEvent } that is fired upon use.
7272 */
73- public void handleButtons (String [] id , ButtonClickEvent event ) {
73+ public void handleButtons (String [] id , ButtonInteractionEvent event ) {
7474 if (!hasPermissions (event .getMember ())) {
7575 event .getHook ().sendMessage ("Insufficient Permissions." ).setEphemeral (true ).queue ();
7676 return ;
@@ -92,9 +92,9 @@ public void handleButtons(String[] id, ButtonClickEvent event) {
9292 * Handles Select Menu interactions regarding the Submission Controls System.
9393 *
9494 * @param id The SelectionMenu's id.
95- * @param event The {@link SelectionMenuEvent } that is fired upon use.
95+ * @param event The {@link SelectMenuInteractionEvent } that is fired upon use.
9696 */
97- public void handleSelectMenus (String [] id , SelectionMenuEvent event ) {
97+ public void handleSelectMenus (String [] id , SelectMenuInteractionEvent event ) {
9898 if (!hasPermissions (event .getMember ())) {
9999 event .getHook ().sendMessage ("Insufficient Permissions." ).setEphemeral (true ).queue ();
100100 return ;
@@ -110,7 +110,7 @@ public void handleSelectMenus(String[] id, SelectionMenuEvent event) {
110110 }
111111 }
112112
113- private void acceptSubmission (ButtonClickEvent event , ThreadChannel thread ) {
113+ private void acceptSubmission (ButtonInteractionEvent event , ThreadChannel thread ) {
114114 try (var con = Bot .dataSource .getConnection ()) {
115115 var repo = new QOTWSubmissionRepository (con );
116116 var submissionOptional = repo .getSubmissionByThreadId (thread .getIdLong ());
@@ -137,11 +137,11 @@ private void acceptSubmission(ButtonClickEvent event, ThreadChannel thread) {
137137 }
138138 }
139139
140- private void declineButtonSubmission (ButtonClickEvent event ) {
140+ private void declineButtonSubmission (ButtonInteractionEvent event ) {
141141 event .getMessage ().editMessageComponents (ActionRow .of (this .buildDeclineMenu ())).queue ();
142142 }
143143
144- private void declineSelectSubmission (SelectionMenuEvent event , ThreadChannel thread ) {
144+ private void declineSelectSubmission (SelectMenuInteractionEvent event , ThreadChannel thread ) {
145145 var reasons = String .join (", " , event .getValues ());
146146 try (var con = Bot .dataSource .getConnection ()) {
147147 var repo = new QOTWSubmissionRepository (con );
@@ -173,7 +173,7 @@ private void declineSelectSubmission(SelectionMenuEvent event, ThreadChannel thr
173173 }
174174 }
175175
176- private void deleteSubmission (ButtonClickEvent event , ThreadChannel thread ) {
176+ private void deleteSubmission (ButtonInteractionEvent event , ThreadChannel thread ) {
177177 thread .delete ().queueAfter (10 , TimeUnit .SECONDS );
178178 log .info ("{} deleted submission thread {}" , event .getUser ().getAsTag (), thread .getName ());
179179 GuildUtils .getLogChannel (event .getGuild ()).sendMessageFormat ("%s deleted submission thread `%s`" , event .getUser ().getAsTag (), thread .getName ()).queue ();
@@ -208,8 +208,8 @@ private List<ActionRow> buildInteractionControls() {
208208 Button .secondary ("submission-controls:delete" , "🗑️" )));
209209 }
210210
211- private SelectionMenu buildDeclineMenu () {
212- return SelectionMenu .create ("submission-controls-select:decline" )
211+ private SelectMenu buildDeclineMenu () {
212+ return SelectMenu .create ("submission-controls-select:decline" )
213213 .setPlaceholder ("Select a reason for declining this submission." )
214214 .setRequiredRange (1 , 3 )
215215 .addOption ("Wrong Answer" , "Wrong Answer" , "The content of the submission was not correct." )
0 commit comments