Skip to content

Commit f60b7d3

Browse files
committed
remove buttons instead of disabling them, cleaner
1 parent 12be373 commit f60b7d3

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

application/src/main/java/org/togetherjava/tjbot/features/moderation/ThisIsScamCommand.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import net.dv8tion.jda.api.events.interaction.component.ButtonInteractionEvent;
1616
import net.dv8tion.jda.api.exceptions.ErrorHandler;
1717
import net.dv8tion.jda.api.interactions.commands.build.Commands;
18-
import net.dv8tion.jda.api.interactions.components.ActionRow;
1918
import net.dv8tion.jda.api.interactions.components.buttons.Button;
2019
import net.dv8tion.jda.api.interactions.components.buttons.ButtonStyle;
2120
import net.dv8tion.jda.api.requests.ErrorResponse;
@@ -217,10 +216,7 @@ public void onButtonClick(ButtonInteractionEvent event, List<String> args) {
217216
List<MessageEmbed> embeds = new ArrayList<>(event.getMessage().getEmbeds());
218217
embeds.add(resultEmbed);
219218

220-
List<Button> disabledButtons =
221-
event.getMessage().getButtons().stream().map(Button::asDisabled).toList();
222-
223-
event.editMessageEmbeds(embeds).setComponents(ActionRow.of(disabledButtons)).queue();
219+
event.editMessageEmbeds(embeds).setComponents().queue();
224220

225221
if (!isScam) {
226222
return;

0 commit comments

Comments
 (0)