use of net.dv8tion.jda.internal.interactions.component.SelectMenuImpl in project Ree6 by Ree6-Applications.
the class Setup method onPerform.
@Override
public void onPerform(CommandEvent commandEvent) {
if (commandEvent.getMember().hasPermission(Permission.ADMINISTRATOR)) {
EmbedBuilder embedBuilder = new EmbedBuilder().setTitle("Setup Menu").setFooter(commandEvent.getGuild().getName() + " - " + Data.ADVERTISEMENT, commandEvent.getGuild().getIconUrl()).setColor(Color.cyan).setDescription("Which configuration do you want to check out?");
List<SelectOption> optionList = new ArrayList<>();
optionList.add(SelectOption.of("Audit-Logging", "log"));
optionList.add(SelectOption.of("Welcome-channel", "welcome"));
optionList.add(SelectOption.of("News-channel", "news"));
optionList.add(SelectOption.of("Mute role", "mute"));
optionList.add(SelectOption.of("Autorole", "autrorole"));
SelectMenu selectMenu = new SelectMenuImpl("setupActionMenu", "Select a configuration Step!", 1, 1, false, optionList);
if (commandEvent.isSlashCommand()) {
commandEvent.getInteractionHook().sendMessageEmbeds(embedBuilder.build()).addActionRow(selectMenu).queue();
} else {
commandEvent.getTextChannel().sendMessageEmbeds(embedBuilder.build()).setActionRows(ActionRow.of(selectMenu)).queue();
}
} else {
sendMessage("You dont have the Permission for this Command!", 5, commandEvent.getTextChannel(), commandEvent.getInteractionHook());
}
deleteMessage(commandEvent.getMessage(), commandEvent.getInteractionHook());
}
Aggregations