use of net.dv8tion.jda.api.EmbedBuilder in project c0debaseBot by Biospheere.
the class Pagination method getEmbed.
public EmbedBuilder getEmbed(final Guild guild, final boolean descending) {
final EmbedBuilder embedBuilder = getEmbed(guild);
embedBuilder.setFooter("Seite: (1/" + ((guild.getMembers().size() / getPageSize()) + 1) + ") Sortierung: " + (descending ? "absteigend" : "aufsteigend"), guild.getIconUrl());
return embedBuilder;
}
use of net.dv8tion.jda.api.EmbedBuilder in project c0debaseBot by Biospheere.
the class Pagination method getEmbed.
public EmbedBuilder getEmbed(final Guild guild, final Integer currentPage, final Integer maxPages, final boolean descending) {
final EmbedBuilder embedBuilder = getEmbed(guild);
embedBuilder.setFooter("Seite: (" + currentPage + "/" + maxPages + ") Sortierung: " + (descending ? "absteigend" : "aufsteigend"), guild.getIconUrl());
return embedBuilder;
}
use of net.dv8tion.jda.api.EmbedBuilder in project c0debaseBot by Biospheere.
the class ServerinfoCommand method execute.
@Override
public void execute(final String[] args, final Message message) {
final EmbedBuilder embedBuilder = getEmbed(message.getGuild(), message.getAuthor());
final Member oldestMember = DiscordUtils.getOldestMember(message.getGuild());
embedBuilder.setTitle(message.getGuild().getName(), "https://c0debase.de");
embedBuilder.setThumbnail(message.getGuild().getIconUrl());
embedBuilder.addField("Erstellt am", message.getGuild().getTimeCreated().format(DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm")), true);
embedBuilder.addField("Region", message.getGuild().getRegionRaw(), true);
embedBuilder.addField("Mitglieder", String.valueOf(message.getGuild().getMemberCount()), true);
embedBuilder.addField("Boosts", String.valueOf(message.getGuild().getBoostCount()), true);
embedBuilder.addField("Text Channels", String.valueOf(message.getGuild().getTextChannels().size()), true);
embedBuilder.addField("Voice Channels", String.valueOf(message.getGuild().getVoiceChannels().size()), true);
embedBuilder.addField("Rollen", String.valueOf(message.getGuild().getRoles().size()), true);
embedBuilder.addField("Owner", StringUtils.replaceCharacter(message.getGuild().getOwner().getUser().getName()) + "#" + message.getGuild().getOwner().getUser().getDiscriminator(), true);
if (oldestMember != null) {
embedBuilder.addField("Ältestes Mitglied", StringUtils.replaceCharacter(oldestMember.getUser().getName()) + "#" + oldestMember.getUser().getDiscriminator(), true);
}
embedBuilder.addField("Erstellt vor", ChronoUnit.DAYS.between(message.getGuild().getTimeCreated(), LocalDateTime.now().atOffset(ZoneOffset.UTC)) + " Tagen", true);
message.getTextChannel().sendMessage(embedBuilder.build()).queue();
}
use of net.dv8tion.jda.api.EmbedBuilder in project c0debaseBot by Biospheere.
the class UserinfoCommand method execute.
@Override
public void execute(final String[] args, final Message message) {
final Member member = DiscordUtils.getAddressedMember(message);
final EmbedBuilder embedBuilder = getEmbed(message.getMember());
embedBuilder.setThumbnail(member.getUser().getAvatarUrl());
embedBuilder.addField("Name", StringUtils.replaceCharacter(member.getUser().getName()), true);
embedBuilder.addField("Nickname", member.getNickname() == null ? StringUtils.replaceCharacter(member.getUser().getName()) : StringUtils.replaceCharacter(member.getNickname()), true);
embedBuilder.addField("Status", member.getOnlineStatus().getKey(), true);
embedBuilder.addField("Spiel", member.getActivities().isEmpty() ? "---" : member.getActivities().get(0).getName(), true);
embedBuilder.addField("Rollen", String.valueOf(member.getRoles().size()), true);
embedBuilder.addField("Beitritt", member.getTimeJoined().format(DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm")), true);
embedBuilder.addField("Erstelldatum: ", member.getUser().getTimeCreated().format(DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm")), true);
embedBuilder.addField("Standard Avatar: ", String.valueOf(member.getUser().getAvatarUrl() == null), true);
message.getTextChannel().sendMessage(embedBuilder.build()).queue();
}
use of net.dv8tion.jda.api.EmbedBuilder in project c0debaseBot by Biospheere.
the class ChangeBannerCommand method execute.
@Override
public void execute(String[] args, Message message) {
if (this.serverBanner == null) {
return;
}
if (!message.getGuild().getFeatures().contains("BANNER")) {
message.getTextChannel().sendMessage(new EmbedBuilder().setDescription("Auf diesem Server kann aktuell kein Banner gesetzt werden!").setColor(Color.RED).build()).queue();
return;
}
this.serverBanner.run();
message.getTextChannel().sendMessage(new EmbedBuilder().setTitle("Erledigt!").setDescription("Force-Update des Banners wurde ausgeführt!").setImage(message.getGuild().getBannerUrl()).setColor(Color.GREEN).build()).queue();
}
Aggregations