Java Code Examples for net.dv8tion.jda.api.EmbedBuilder#setDescription()
The following examples show how to use
net.dv8tion.jda.api.EmbedBuilder#setDescription() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MessageEditAuditForwardProvider.java From JuniperBot with GNU General Public License v3.0 | 6 votes |
@Override protected void build(AuditAction action, MessageBuilder messageBuilder, EmbedBuilder embedBuilder) { String messageId = action.getAttribute(MESSAGE_ID, String.class); if (action.getChannel() == null || action.getUser() == null || messageId == null) { return; } embedBuilder.setDescription(messageService.getMessage("audit.message.edit.message", String.valueOf(action.getGuildId()), action.getChannel().getId(), messageId)); addOldContentField(action, embedBuilder); embedBuilder.addField(messageService.getMessage("audit.message.newContent.title"), getMessageValue(action, NEW_CONTENT), false); addAuthorField(action, embedBuilder); addChannelField(action, embedBuilder); embedBuilder.setFooter(messageService.getMessage("audit.message.id", messageId), null); }
Example 2
Source File: MemberWarnAuditForwardProvider.java From JuniperBot with GNU General Public License v3.0 | 6 votes |
@Override protected void build(AuditAction action, MessageBuilder messageBuilder, EmbedBuilder embedBuilder) { if (action.getTargetUser() == null) { return; } String message = messageService.getMessage("audit.member.warn.message", getReferenceContent(action.getTargetUser(), false)); embedBuilder.setDescription(message); addModeratorField(action, embedBuilder); Number count = action.getAttribute(COUNT_ATTR, Number.class); if (count != null) { embedBuilder.addField(messageService.getMessage("audit.member.warn.count.title"), messageService.getMessage("audit.member.warn.count.content", count), true); } addReasonField(action, embedBuilder); addExpirationField(action, embedBuilder); embedBuilder.setFooter(messageService.getMessage("audit.member.id", action.getTargetUser().getId()), null); }
Example 3
Source File: GroovyCommand.java From JuniperBot with GNU General Public License v3.0 | 6 votes |
@Override public boolean doCommand(GuildMessageReceivedEvent message, BotContext context, String query) { if (!enabled || !discordService.isSuperUser(message.getAuthor()) || StringUtils.isEmpty(query)) { return false; } message.getChannel().sendTyping().queue(); String script = CommonUtils.unwrapCode(query); try { Object result = getShell(message).evaluate(script); if (result != null) { messageService.sendMessageSilent(message.getChannel()::sendMessage, "```groovy\n" + String.valueOf(result) + "```"); } } catch (Exception e) { String errorText = String.format("\n`%s`\n\nStack trace:```javascript\n%s", e.getMessage(), ExceptionUtils.getStackTrace(e)); EmbedBuilder builder = messageService.getBaseEmbed(); builder.setTitle(e.getClass().getName()); builder.setColor(Color.RED); builder.setDescription(CommonUtils.trimTo(errorText, 2045) + "```"); messageService.sendMessageSilent(message.getChannel()::sendMessage, builder.build()); return fail(message); } return ok(message); }
Example 4
Source File: AvatarCommand.java From JuniperBot with GNU General Public License v3.0 | 6 votes |
@Override public boolean doCommand(MemberReference reference, GuildMessageReceivedEvent event, BotContext context, String query) { String avatarUrl = reference.getEffectiveAvatarUrl(); if (StringUtils.isEmpty(avatarUrl)) { messageService.onEmbedMessage(event.getChannel(), "discord.command.avatar.none"); return false; } String name = reference.getEffectiveName(); EmbedBuilder builder = messageService.getBaseEmbed(); if (StringUtils.isNotEmpty(name)) { builder.setDescription(messageService.getMessage("discord.command.avatar.text", name)); } builder.setImage(avatarUrl + "?size=512"); messageService.sendMessageSilent(event.getChannel()::sendMessage, builder.build()); return true; }
Example 5
Source File: EmergencyServiceImpl.java From JuniperBot with GNU General Public License v3.0 | 6 votes |
@Override public void error(String message, Throwable throwable) { Long emergencyChannelId = workerProperties.getSupport().getEmergencyChannelId(); if (emergencyChannelId == null || !discordService.isConnected(workerProperties.getSupport().getGuildId())) { return; } TextChannel channel = discordService.getShardManager().getTextChannelById(emergencyChannelId); if (channel == null) { return; } String errorText = String.format("`%s`\n\nStack trace:```javascript\n%s", throwable.getMessage(), ExceptionUtils.getStackTrace(throwable)); EmbedBuilder builder = messageService.getBaseEmbed(); builder.setTitle(message); builder.setColor(Color.RED); builder.setDescription(CommonUtils.trimTo(errorText, 2045) + "```"); MessageBuilder messageBuilder = new MessageBuilder(); messageBuilder.setContent("@here"); messageBuilder.setEmbed(builder.build()); messageService.sendMessageSilent(channel::sendMessage, messageBuilder.build()); }
Example 6
Source File: AbstractStateHandler.java From JuniperBot with GNU General Public License v3.0 | 5 votes |
protected EmbedBuilder getBaseEmbed(String code, Object... args) { EmbedBuilder embed = getBaseEmbed(); if (StringUtils.isNotEmpty(code)) { embed.setDescription(messageService.getMessage(code, args)); } return embed; }
Example 7
Source File: HelpCommand.java From JuniperBot with GNU General Public License v3.0 | 5 votes |
private EmbedBuilder getBaseEmbed(String group) { EmbedBuilder embedBuilder = messageService.getBaseEmbed(true) .setThumbnail(commonProperties.getBranding().getAvatarSmallUrl()); if (COMMON_GROUP.equals(group)) { embedBuilder.setDescription(messageService.getMessage("discord.command.help.title")); } else { embedBuilder.setDescription(messageService.getMessage("discord.command.help.group.title", messageService.getMessage(group))); } return embedBuilder; }
Example 8
Source File: GuildListener.java From JuniperBot with GNU General Public License v3.0 | 5 votes |
private MessageEmbed createWelcomeMessage(Guild guild) { Function<String, String> m = messageService::getMessage; String webPage = m.apply("about.support.page"); String discordServer = m.apply("about.support.server"); String githubPage = m.apply("about.support.github"); EmbedBuilder builder = messageService.getBaseEmbed(true); builder.setDescription(messageService.getMessage("welcome.guild.message") + NEW_LINE); User self = guild.getJDA().getSelfUser(); builder.setAuthor(self.getName(), webPage, self.getAvatarUrl()); builder.addField(m.apply("welcome.fields.common.title"), m.apply("welcome.fields.common.content") + NEW_LINE, false); builder.addField(m.apply("welcome.fields.music.title"), m.apply("welcome.fields.music.content") + NEW_LINE, false); builder.addField(m.apply("welcome.fields.audit.title"), m.apply("welcome.fields.audit.content") + NEW_LINE, false); builder.addField(m.apply("welcome.fields.subscriptions.title"), m.apply("welcome.fields.subscriptions.content") + NEW_LINE, false); builder.addField(m.apply("welcome.fields.ranking.title"), m.apply("welcome.fields.ranking.content") + NEW_LINE, false); builder.addField(m.apply("welcome.fields.welcome.title"), m.apply("welcome.fields.welcome.content") + NEW_LINE, false); builder.addField(m.apply("welcome.fields.commands.title"), m.apply("welcome.fields.commands.content") + NEW_LINE, false); builder.addField(m.apply("welcome.fields.custom.title"), m.apply("welcome.fields.custom.content") + NEW_LINE, false); builder.addField(m.apply("welcome.fields.fun.title"), m.apply("welcome.fields.fun.content") + NEW_LINE, false); builder.addField(m.apply("welcome.fields.support.title"), messageService.getMessage("welcome.fields.support.content", webPage, discordServer, githubPage), false); return builder.build(); }
Example 9
Source File: InviteCommand.java From JuniperBot with GNU General Public License v3.0 | 5 votes |
private MessageEmbed createInfoMessage(InviteInfo inviteInfo, BotContext context) { EmbedBuilder builder = messageService.getBaseEmbed(false); if (inviteInfo.getGuild() != null) { InviteInfo.Guild guildInfo = inviteInfo.getGuild(); String iconUrl = AvatarType.ICON.getUrl(guildInfo.getId(), guildInfo.getIcon()); String inviteUrl = "https://discord.gg/" + (StringUtils.isNotEmpty(guildInfo.getVanityUrlCode()) ? guildInfo.getVanityUrlCode() : inviteInfo.getCode()); builder.setTitle(String.format("%s (ID: %s)", guildInfo.getName(), guildInfo.getId()), inviteUrl); builder.setDescription(guildInfo.getDescription()); builder.setThumbnail(iconUrl); Guild guild = discordService.getGuildById(Long.valueOf(guildInfo.getId())); if (guild != null) { builder.addField(getMemberListField(guild)); builder.addField(getChannelListField(guild)); builder.addField(getShard(guild)); builder.addField(getVerificationLevel(guild.getVerificationLevel())); builder.addField(getRegion(guild)); builder.addField(getOwner(guild)); builder.addField(getCreatedAt(guild, context)); } else { if (guildInfo.getVerificationLevel() != null) { builder.addField(getVerificationLevel(Guild.VerificationLevel.fromKey(guildInfo.getVerificationLevel()))); } } } if (inviteInfo.getChannel() != null) { InviteInfo.Channel channel = inviteInfo.getChannel(); String info = String.format("`#%s` (ID: %s)", channel.getName(), channel.getId()); builder.addField(messageService.getMessage("discord.command.invite.channel"), info, true); } if (inviteInfo.getInviter() != null) { InviteInfo.Inviter inviter = inviteInfo.getInviter(); String avatarUrl = StringUtils.isNotEmpty(inviter.getAvatar()) ? AvatarType.AVATAR.getUrl(inviter.getId(), inviter.getAvatar()) : null; builder.setFooter(String.format("%s#%s (ID: %s)", inviter.getUsername(), inviter.getDiscriminator(), inviter.getId()), avatarUrl); } return builder.build(); }
Example 10
Source File: InfoCommand.java From JuniperBot with GNU General Public License v3.0 | 5 votes |
@Override public boolean doCommand(GuildMessageReceivedEvent message, BotContext context, String query) { String prefix = context.getConfig() != null ? context.getConfig().getPrefix() : commonProperties.getDiscord().getDefaultPrefix(); EmbedBuilder builder = messageService.getBaseEmbed(true); builder.setAuthor(message.getJDA().getSelfUser().getName(), messageService.getMessage("about.support.page")); builder.setThumbnail(commonProperties.getBranding().getAvatarSmallUrl()); String helpCommand = messageService.getMessageByLocale("discord.command.help.key", context.getCommandLocale()); builder.setDescription(messageService.getMessage("discord.command.info.description", prefix, helpCommand)); builder.addField( messageService.getMessage("discord.command.info.author.title"), messageService.getMessage("about.support.owner"), true); DateTimeFormatter formatter = DateTimeFormat .mediumDateTime() .withLocale(contextService.getLocale()) .withZone(context.getTimeZone()); builder.addField( messageService.getMessage("discord.command.info.version.title"), String.format("%s (%s)", appVersion, formatter.print(buildTimestamp)), true); builder.addField( messageService.getMessage("discord.command.info.links.title"), messageService.getMessage("discord.command.info.links.content"), true); builder.addField( messageService.getMessage("discord.command.info.framework.title"), messageService.getMessage("discord.command.info.framework.content", jdaVersion, lavaPlayerVersion, springVersion), true); messageService.sendMessageSilent(message.getChannel()::sendMessage, builder.build()); return true; }
Example 11
Source File: IndividualHandler.java From JuniperBot with GNU General Public License v3.0 | 5 votes |
@Override public boolean onStart(User user, MafiaInstance instance) { MafiaPlayer individual = instance.getPlayerByRole(individualRole); if (individual == null) { return getNextHandler().onStart(user, instance); } MafiaState oldState = instance.updateState(state); StringBuilder messageBuilder = new StringBuilder(); if (oldState.getTransitionEnd() != null) { messageBuilder.append(messageService.getMessage(oldState.getTransitionEnd())).append(" "); } if (state.getTransitionStart() != null) { messageBuilder.append(messageService.getMessage(state.getTransitionStart())); } if (messageBuilder.length() > 0) { EmbedBuilder builder = getBaseEmbed(); builder.setDescription(messageBuilder.toString()); TextChannel channel = instance.getChannel(); if (channel == null) { return true; // end for non existent channel instantly } channel.sendMessage(builder.build()).queue(); } if (!sendChoiceMessage(instance, individualRole.getChoiceMessage())) { instance.setEndReason(messageService.getMessage("mafia.end.reason.couldNotDM", individual.getName())); return true; } return scheduleEnd(instance, INDIVIDUAL_DELAY); }
Example 12
Source File: AudioMessageManager.java From JuniperBot with GNU General Public License v3.0 | 5 votes |
public void onQueueEnd(TrackRequest request) { TextChannel channel = request.getChannel(); if (channel == null) { return; } EmbedBuilder builder = getQueueMessage(); builder.setDescription(messageService.getMessage("discord.command.audio.queue.end")); messageService.sendMessageSilent(channel::sendMessage, builder.build()); }
Example 13
Source File: EmbedJSON.java From MantaroBot with GNU General Public License v3.0 | 5 votes |
public MessageEmbed gen(Member member) { EmbedBuilder embedBuilder = new EmbedBuilder(); if (title != null) embedBuilder.setTitle(title, titleUrl); if (description != null) embedBuilder.setDescription(description); if (author != null) embedBuilder.setAuthor(author, authorUrl, authorImg); if (footer != null) embedBuilder.setFooter(footer, footerImg); if (image != null) embedBuilder.setImage(image); if (thumbnail != null) embedBuilder.setThumbnail(thumbnail); if (color != null) { Color col = null; try { col = (Color) Color.class.getField(color).get(null); } catch (Exception ignored) { String colorLower = color.toLowerCase(); if (colorLower.equals("member")) { if (member != null) col = member.getColor(); } else if (colorLower.matches("#?(0x)?[0123456789abcdef]{1,6}")) { try { col = Color.decode(colorLower.startsWith("0x") ? colorLower : "0x" + colorLower); } catch (Exception ignored2) { } } } if (col != null) embedBuilder.setColor(col); } fields.forEach(f -> { if (f == null) { embedBuilder.addBlankField(false); } else if (f.value == null) { embedBuilder.addBlankField(f.inline); } else { embedBuilder.addField(f.name == null ? "" : f.name, f.value, f.inline); } }); return embedBuilder.build(); }
Example 14
Source File: NicknameChangeAuditForwardProvider.java From JuniperBot with GNU General Public License v3.0 | 5 votes |
@Override protected void build(AuditAction action, MessageBuilder messageBuilder, EmbedBuilder embedBuilder) { if (action.getUser() != null) { embedBuilder.setDescription(messageService.getMessage("audit.message.nickname.change.message", getReferenceContent(action.getUser(), false))); embedBuilder.addField(messageService.getMessage("audit.message.nickname.old.title"), action.getAttribute(OLD_NAME, String.class), true); embedBuilder.addField(messageService.getMessage("audit.message.nickname.new.title"), action.getAttribute(NEW_NAME, String.class), true); embedBuilder.setFooter(messageService.getMessage("audit.member.id", action.getUser().getId()), null); } }
Example 15
Source File: MessageServiceImpl.java From JuniperBot with GNU General Public License v3.0 | 4 votes |
@Override public void onTempEmbedMessage(MessageChannel sourceChannel, int sec, String code, Object... args) { EmbedBuilder builder = getBaseEmbed(); builder.setDescription(getMessage(code, args)); sendTempMessageSilent(sourceChannel::sendMessage, builder.build(), sec); }
Example 16
Source File: GuildListener.java From JuniperBot with GNU General Public License v3.0 | 4 votes |
@Override public void onGuildJoin(GuildJoinEvent event) { Guild guild = event.getGuild(); Member self = guild.getSelfMember(); TextChannel channel = guild.getDefaultChannel(); if (channel != null && !self.hasPermission(channel, Permission.MESSAGE_WRITE, Permission.MESSAGE_EMBED_LINKS)) { channel = null; } if (channel == null) { for (TextChannel textChannel : guild.getTextChannels()) { if (self.hasPermission(textChannel, Permission.MESSAGE_WRITE, Permission.MESSAGE_EMBED_LINKS)) { channel = textChannel; break; } } } Gulag gulag = gulagService.getGulag(guild); if (gulag != null) { if (channel != null) { EmbedBuilder builder = messageService.getBaseEmbed(); builder.setDescription(messageService.getMessage("discord.gulag.message")); builder.addField(messageService.getMessage("discord.gulag.reason"), CommonUtils.trimTo(gulag.getReason(), MessageEmbed.VALUE_MAX_LENGTH), true); channel.sendMessage(builder.build()).queue(e -> guild.leave().queue(), e -> guild.leave().queue()); } else { guild.leave().queue(); } return; } GuildConfig config = entityAccessor.getOrCreate(event.getGuild()); switch (event.getGuild().getRegion()) { case RUSSIA: config.setLocale(LocaleUtils.RU_LOCALE); config.setCommandLocale(LocaleUtils.RU_LOCALE); break; default: config.setLocale(LocaleUtils.DEFAULT_LOCALE); config.setCommandLocale(LocaleUtils.DEFAULT_LOCALE); break; } configService.save(config); contextService.initContext(event.getGuild()); // reinit context with updated locale sendWelcome(channel, event); }
Example 17
Source File: AudioMessageManager.java From JuniperBot with GNU General Public License v3.0 | 4 votes |
private EmbedBuilder getPlayMessage(TrackRequest request) { EmbedBuilder builder = getBasicMessage(request); builder.setDescription(null); AudioTrackInfo info = request.getTrack().getInfo(); PlaybackInstance instance = TrackData.get(request.getTrack()).getInstance(); boolean refreshable = isRefreshable(instance.getGuildId()); String durationText; if (request.getEndReason() != null) { StringBuilder reasonBuilder = new StringBuilder(); boolean hasDuration = !info.isStream && info.length > 0; if (hasDuration) { reasonBuilder.append(CommonUtils.formatDuration(request.getTrack().getDuration())).append(" ("); } reasonBuilder.append(messageService.getEnumTitle(request.getEndReason())); String endMember = getMemberName(request, true); if (StringUtils.isNotBlank(endMember)) { reasonBuilder .append(" - **") .append(endMember) .append("**"); } if (hasDuration) { reasonBuilder.append(")"); } reasonBuilder.append(CommonUtils.EMPTY_SYMBOL); durationText = reasonBuilder.toString(); } else { durationText = getTextProgress(instance, request.getTrack(), refreshable); } if (instance.getPlaylistUuid() != null) { builder.setDescription(messageService.getMessage("discord.command.audio.panel.playlist", commonProperties.getBranding().getWebsiteUrl(), instance.getPlaylistUuid())); } int size = instance.getQueue().size(); if (request.getEndReason() == null && size > 1) { MusicConfig config = musicConfigService.getByGuildId(instance.getGuildId()); if (config != null && config.isShowQueue()) { List<TrackRequest> next = instance.getQueue().subList(1, Math.min(size, MAX_SHORT_QUEUE + 1)); addQueue(builder, instance, next, 2 + instance.getCursor(), true); } } if (request.getTrack().getInfo().isStream || !refreshable) { builder.addField(messageService.getMessage("discord.command.audio.panel.duration"), durationText, true); builder.addField(messageService.getMessage("discord.command.audio.panel.requestedBy"), getMemberName(request, false), true); } else { String requestedBy = String.format("%s: %s", messageService.getMessage("discord.command.audio.panel.requestedBy"), getMemberName(request, false)); builder.addField(requestedBy, durationText, true); } if (request.getEndReason() == null) { IPlayer player = instance.getPlayer(); if (player.getVolume() != 100) { int volume = player.getVolume(); builder.addField(messageService.getMessage("discord.command.audio.panel.volume"), String.format("%d%% %s", volume, CommonUtils.getVolumeIcon(volume)), true); } if (!RepeatMode.NONE.equals(instance.getMode())) { builder.addField(messageService.getMessage("discord.command.audio.panel.repeatMode"), instance.getMode().getEmoji(), true); } if (player.isPaused()) { builder.addField(messageService.getMessage("discord.command.audio.panel.paused"), "\u23F8", true); } if (player instanceof LavalinkPlayer) { LavalinkPlayer lavalinkPlayer = (LavalinkPlayer) player; Link link = lavalinkPlayer.getLink(); if (link != null) { LavalinkSocket socket = link.getNode(false); if (socket != null) { StringBuilder statsBuilder = new StringBuilder(messageService .getMessage("discord.command.audio.panel.poweredBy", socket.getName())); if (refreshable && socket.getStats() != null) { long load = Math.round(socket.getStats().getSystemLoad() * 100); if (load < 0) load = 0; if (load > 100) load = 100; statsBuilder .append(" ") .append(messageService.getMessage("discord.command.audio.panel.load", load)); } builder.setFooter(statsBuilder.toString(), null); } } } } return builder; }
Example 18
Source File: UserInfoCommand.java From JuniperBot with GNU General Public License v3.0 | 4 votes |
@Override public boolean doCommand(MemberReference reference, GuildMessageReceivedEvent event, BotContext context, String query) { DateTimeFormatter formatter = DateTimeFormat.mediumDateTime() .withLocale(contextService.getLocale()) .withZone(context.getTimeZone()); LocalMember localMember = reference.getLocalMember(); LocalUser localUser = reference.getLocalUser(); EmbedBuilder builder = messageService.getBaseEmbed(); builder.setTitle(messageService.getMessage("discord.command.user.title", reference.getEffectiveName())); builder.setThumbnail(reference.getEffectiveAvatarUrl()); builder.setFooter(messageService.getMessage("discord.command.info.identifier", reference.getId()), null); StringBuilder commonBuilder = new StringBuilder(); getName(commonBuilder, reference); if (reference.getMember() != null) { Member member = reference.getMember(); getOnlineStatus(commonBuilder, member); if (CollectionUtils.isNotEmpty(member.getActivities())) { getActivities(commonBuilder, member); } if (member.getOnlineStatus() == OnlineStatus.OFFLINE || member.getOnlineStatus() == OnlineStatus.INVISIBLE) { if (localUser != null && localUser.getLastOnline() != null) { getLastOnlineAt(commonBuilder, localUser, formatter); } } getJoinedAt(commonBuilder, member, formatter); getCreatedAt(commonBuilder, member.getUser(), formatter); } builder.addField(messageService.getMessage("discord.command.user.common"), commonBuilder.toString(), false); Guild guild = event.getGuild(); if (localMember != null) { RankingConfig config = rankingConfigService.get(event.getGuild()); if (config != null && config.isEnabled()) { RankingInfo info = rankingService.getRankingInfo(event.getGuild().getIdLong(), reference.getId()); rankCommand.addFields(builder, config, info, guild); } } MemberBio memberBio = bioRepository.findByGuildIdAndUserId(guild.getIdLong(), reference.getId()); String bio = memberBio != null ? memberBio.getBio() : null; if (StringUtils.isEmpty(bio) && Objects.equals(event.getAuthor(), reference.getUser()) && !commandsService.isRestricted(BioCommand.KEY, event.getChannel(), event.getMember())) { String bioCommand = messageService.getMessageByLocale("discord.command.bio.key", context.getCommandLocale()); bio = messageService.getMessage("discord.command.user.bio.none", context.getConfig().getPrefix(), bioCommand); } if (StringUtils.isNotEmpty(bio)) { builder.setDescription(CommonUtils.trimTo(bio, MessageEmbed.TEXT_MAX_LENGTH)); } messageService.sendMessageSilent(event.getChannel()::sendMessage, builder.build()); return true; }
Example 19
Source File: AudioMessageManager.java From JuniperBot with GNU General Public License v3.0 | 4 votes |
public void onQueue(PlaybackInstance instance, MessageChannel sourceChannel, BotContext context, int pageNum) { List<TrackRequest> requests = instance.getQueue(); if (requests.isEmpty()) { onEmptyQueue(sourceChannel); return; } final int pageSize = 25; List<List<TrackRequest>> parts = Lists.partition(requests, pageSize); final int totalPages = parts.size(); final int offset = (pageNum - 1) * pageSize + 1 + instance.getCursor(); final long totalDuration = requests.stream() .filter(Objects::nonNull) .map(TrackRequest::getTrack) .filter(Objects::nonNull) .mapToLong(AudioTrack::getDuration).sum(); if (pageNum > totalPages) { onQueueError(sourceChannel, "discord.command.audio.queue.list.totalPages", parts.size()); return; } List<TrackRequest> pageRequests = parts.get(pageNum - 1); EmbedBuilder builder = getQueueMessage(); if (instance.getCursor() > 0) { builder.setDescription(messageService.getMessage("discord.command.audio.queue.list.playlist.played", instance.getCursor(), commonProperties.getBranding().getWebsiteUrl(), instance.getPlaylistUuid())); } else { builder.setDescription(messageService.getMessage("discord.command.audio.queue.list.playlist", commonProperties.getBranding().getWebsiteUrl(), instance.getPlaylistUuid())); } addQueue(builder, instance, pageRequests, offset, false); String queueCommand = messageService.getMessageByLocale("discord.command.queue.key", context.getCommandLocale()); builder.setFooter(totalPages > 1 ? messageService.getMessage("discord.command.audio.queue.list.pageFooter", pageNum, totalPages, requests.size(), CommonUtils.formatDuration(totalDuration), context.getConfig().getPrefix(), queueCommand) : messageService.getMessage("discord.command.audio.queue.list.footer", requests.size(), CommonUtils.formatDuration(totalDuration)), null); messageService.sendMessageSilent(sourceChannel::sendMessage, builder.build()); }
Example 20
Source File: AudioMessageManager.java From JuniperBot with GNU General Public License v3.0 | 4 votes |
public void onIdle(MessageChannel sourceChannel) { EmbedBuilder builder = getQueueMessage(); builder.setDescription(messageService.getMessage("discord.command.audio.queue.idle")); messageService.sendMessageSilent(sourceChannel::sendMessage, builder.build()); }