File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
src/main/java/net/modgarden/gardenbot/interaction/response Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 77import net .dv8tion .jda .api .events .interaction .command .SlashCommandInteractionEvent ;
88import net .dv8tion .jda .api .events .interaction .component .ButtonInteractionEvent ;
99import net .dv8tion .jda .api .interactions .callbacks .IReplyCallback ;
10+ import net .dv8tion .jda .api .interactions .components .ActionRow ;
1011import net .dv8tion .jda .api .interactions .components .buttons .Button ;
1112import net .dv8tion .jda .api .interactions .components .buttons .ButtonStyle ;
1213import net .dv8tion .jda .api .requests .RestAction ;
@@ -40,10 +41,14 @@ public MessageEmbed createEmbed() {
4041
4142 return embed .build ();
4243 }
43-
44+
4445 public RestAction <?> createAction (IReplyCallback callback ) {
4546 if (callback .isAcknowledged ()) {
4647 callback .getHook ().editOriginalEmbeds (createEmbed ()).queue ();
48+
49+ if (!buttons .isEmpty ())
50+ callback .getHook ().editOriginalComponents (ActionRow .of (buttons .toArray (Button []::new ))).queue ();
51+
4752 return callback .getHook ().retrieveOriginal ();
4853 }
4954 ReplyCallbackAction action = callback .replyEmbeds (createEmbed ()).setEphemeral (isEphemeral ());
You can’t perform that action at this time.
0 commit comments