Search in sources :

Example 1 with SelectMenuImpl

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());
}
Also used : SelectMenu(net.dv8tion.jda.api.interactions.components.selections.SelectMenu) EmbedBuilder(net.dv8tion.jda.api.EmbedBuilder) SelectOption(net.dv8tion.jda.api.interactions.components.selections.SelectOption) ArrayList(java.util.ArrayList) SelectMenuImpl(net.dv8tion.jda.internal.interactions.component.SelectMenuImpl)

Aggregations

ArrayList (java.util.ArrayList)1 EmbedBuilder (net.dv8tion.jda.api.EmbedBuilder)1 SelectMenu (net.dv8tion.jda.api.interactions.components.selections.SelectMenu)1 SelectOption (net.dv8tion.jda.api.interactions.components.selections.SelectOption)1 SelectMenuImpl (net.dv8tion.jda.internal.interactions.component.SelectMenuImpl)1