use of net.dv8tion.jda.api.EmbedBuilder in project c0debaseBot by Biospheere.
the class MessageReceiveListener method createPoll.
private void createPoll(final Message message) {
final EmbedBuilder embedBuilder = DiscordUtils.getDefaultEmbed(message.getMember());
embedBuilder.setColor(Color.GREEN);
embedBuilder.setTitle("Poll");
embedBuilder.setDescription(message.getContentDisplay());
message.delete().queue();
message.getChannel().sendMessage(embedBuilder.build()).queue(sentMessage -> {
sentMessage.addReaction(EmojiManager.getForAlias("thumbsup").getUnicode()).queue();
sentMessage.addReaction(EmojiManager.getForAlias("thumbsdown").getUnicode()).queue();
});
}
use of net.dv8tion.jda.api.EmbedBuilder in project c0debaseBot by Biospheere.
the class MessageReceiveListener method onPrivateMessageReceived.
@Override
public void onPrivateMessageReceived(PrivateMessageReceivedEvent event) {
if (event.getAuthor().isBot()) {
return;
}
final EmbedBuilder embedBuilder = new EmbedBuilder();
embedBuilder.setColor(Color.RED);
embedBuilder.appendDescription("Private Nachrichten sind deaktiviert");
event.getChannel().sendMessage(embedBuilder.build()).queue();
}
use of net.dv8tion.jda.api.EmbedBuilder in project c0debaseBot by Biospheere.
the class Pagination method createFirst.
public void createFirst(boolean descending, TextChannel textChannel) {
final EmbedBuilder embedBuilder = getEmbed(textChannel.getGuild(), descending);
buildList(embedBuilder, 1, descending, textChannel.getGuild());
textChannel.sendMessage(embedBuilder.build()).queue((Message success) -> {
success.addReaction(EmojiManager.getForAlias("arrow_left").getUnicode()).queue();
success.addReaction(EmojiManager.getForAlias("arrow_right").getUnicode()).queue();
});
}
use of net.dv8tion.jda.api.EmbedBuilder in project c0debaseBot by Biospheere.
the class Pagination method update.
public void update(Message success, MessageEmbed messageEmbed, String emote) {
int current = getCurrentPage(messageEmbed);
if (emote.equalsIgnoreCase("arrow_left") && current == 1) {
return;
}
final int max = getMaxPages(messageEmbed);
final boolean descending = isDescending(messageEmbed);
if (max != current) {
if (emote.equalsIgnoreCase("arrow_right")) {
current++;
} else if (emote.equalsIgnoreCase("arrow_left") && current > 1) {
current--;
}
} else if (emote.equalsIgnoreCase("arrow_left") && current > 1) {
current--;
}
if (current > 0) {
final EmbedBuilder embedBuilder = getEmbed(success.getGuild(), current, max, descending);
buildList(embedBuilder, current, descending, success.getGuild());
success.editMessage(embedBuilder.build()).queue();
}
}
use of net.dv8tion.jda.api.EmbedBuilder in project c0debaseBot by Biospheere.
the class NitroLeaderboard method getEmbed.
@Override
public EmbedBuilder getEmbed(final Guild guild, final boolean descending) {
final EmbedBuilder embedBuilder = getEmbed(guild);
embedBuilder.setFooter("Seite: (1/" + ((getSortedNitroBoosters(guild).size() / getPageSize()) + 1) + ") Sortierung: " + (descending ? "absteigend" : "aufsteigend"), guild.getIconUrl());
return embedBuilder;
}
Aggregations