Search in sources :

Example 11 with EmbedBuilder

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();
    });
}
Also used : EmbedBuilder(net.dv8tion.jda.api.EmbedBuilder)

Example 12 with EmbedBuilder

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();
}
Also used : EmbedBuilder(net.dv8tion.jda.api.EmbedBuilder)

Example 13 with EmbedBuilder

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();
    });
}
Also used : EmbedBuilder(net.dv8tion.jda.api.EmbedBuilder) Message(net.dv8tion.jda.api.entities.Message)

Example 14 with EmbedBuilder

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();
    }
}
Also used : EmbedBuilder(net.dv8tion.jda.api.EmbedBuilder)

Example 15 with EmbedBuilder

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;
}
Also used : EmbedBuilder(net.dv8tion.jda.api.EmbedBuilder)

Aggregations

EmbedBuilder (net.dv8tion.jda.api.EmbedBuilder)47 Member (net.dv8tion.jda.api.entities.Member)8 TimeUnit (java.util.concurrent.TimeUnit)7 Collectors (java.util.stream.Collectors)7 Message (net.dv8tion.jda.api.entities.Message)7 Context (net.kodehawa.mantarobot.core.modules.commands.base.Context)7 MantaroData (net.kodehawa.mantarobot.data.MantaroData)7 EmoteReference (net.kodehawa.mantarobot.utils.commands.EmoteReference)7 Color (java.awt.Color)6 MessageBuilder (net.dv8tion.jda.api.MessageBuilder)6 MessageEmbed (net.dv8tion.jda.api.entities.MessageEmbed)6 Utils (net.kodehawa.mantarobot.utils.Utils)6 Subscribe (com.google.common.eventbus.Subscribe)5 List (java.util.List)5 Role (net.dv8tion.jda.api.entities.Role)5 CommandCategory (net.kodehawa.mantarobot.core.modules.commands.base.CommandCategory)5 HelpContent (net.kodehawa.mantarobot.core.modules.commands.help.HelpContent)5 I18nContext (net.kodehawa.mantarobot.core.modules.commands.i18n.I18nContext)5 LinkedList (java.util.LinkedList)4 Permission (net.dv8tion.jda.api.Permission)4