use of com.freya02.botcommands.api.prefixed.CommandEvent in project BotCommands by freya022.
the class MessageComponents method execute.
@JDATextCommand(name = "components")
public void execute(CommandEvent event) {
final ActionRow firstRow = ActionRow.of(Components.selectionMenu(SELECTION_HANDLER_NAME).addOption("Option 1", "Value 1").addOption("Option 2", "Value 2").addOption("Option 3", "Value 3").setPlaceholder("Select a value").build());
final ActionRow secondRow = ActionRow.of(Components.primaryButton(BUTTON_HANDLER_NAME).build("Primary button (persistent, no group)"));
event.getMessage().reply("Components !").setActionRows(firstRow, secondRow).queue();
}
use of com.freya02.botcommands.api.prefixed.CommandEvent in project BotCommands by freya022.
the class EnableInfoCommand method execute.
@JDATextCommand(name = "enableinfocommand", description = "Enables the /info command")
public void execute(CommandEvent event) {
if (event.getMember().canInteract(event.getGuild().getSelfMember())) {
final BasicSettingsProvider settingsProvider = (BasicSettingsProvider) event.getContext().getSettingsProvider();
if (settingsProvider == null) {
event.indicateError("No settings provider has been set").queue();
return;
}
settingsProvider.addCommand(event.getGuild(), "info");
event.reactSuccess().queue();
} else {
event.indicateError("You cannot do this").queue();
}
}
Aggregations