impl a EmbedDescriptionBuilder
All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 38s

This commit is contained in:
Lee
2024-07-02 01:51:13 +01:00
parent 4f975ab07a
commit 317eaaec8a
4 changed files with 62 additions and 29 deletions

View File

@ -2,6 +2,7 @@ package cc.fascinated.bat.features.base.commands.general;
import cc.fascinated.bat.command.BatCommand;
import cc.fascinated.bat.command.CommandInfo;
import cc.fascinated.bat.common.EmbedDescriptionBuilder;
import cc.fascinated.bat.common.EmbedUtils;
import cc.fascinated.bat.common.NumberFormatter;
import cc.fascinated.bat.common.TimeUtils;
@ -42,15 +43,16 @@ public class BotStatsCommand extends BatCommand {
JDA jda = DiscordService.JDA;
event.replyEmbeds(EmbedUtils.genericEmbed().setDescription(
"**Bot Statistics**\n" +
"Guilds: **%s**\n".formatted(NumberFormatter.format(jda.getGuilds().size())) +
"Users: **%s**\n".formatted(NumberFormatter.format(jda.getUsers().size())) +
"Gateway Ping: **%sms**\n".formatted(jda.getGatewayPing()) +
"\n" +
"**Bat Statistics**\n" +
"Uptime: **%s**\n".formatted(TimeUtils.format(bean.getUptime())) +
"Cached Guilds: **%s**\n".formatted(NumberFormatter.format(guildService.getGuilds().size())) +
"Cached Users: **%s**".formatted(NumberFormatter.format(userService.getUsers().size()))
new EmbedDescriptionBuilder("Bat Statistics")
.appendLine("Guilds: **%s**".formatted(NumberFormatter.format(jda.getGuilds().size())), true)
.appendLine("Users: **%s**".formatted(NumberFormatter.format(jda.getUsers().size())), true)
.appendLine("Gateway Ping: **%sms**".formatted(jda.getGatewayPing()), true)
.emptyLine()
.appendSubtitle("Bot Statistics")
.appendLine("Uptime: **%s**".formatted(TimeUtils.format(bean.getUptime())), true)
.appendLine("Cached Guilds: **%s**".formatted(NumberFormatter.format(guildService.getGuilds().size())), true)
.appendLine("Cached Users: **%s**".formatted(NumberFormatter.format(userService.getUsers().size())), true)
.build()
).build()).queue();
}
}