From 996cedb15496c9242a9a73f50dc3fb8894403ddc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beatrice=20Dellac=C3=A0?= Date: Mon, 21 Nov 2022 14:54:45 +0100 Subject: [PATCH] Finish botinfo command I don't know what else to add, and it looks nice now. --- .../hidekobot/commands/slash/BotInfoCommand.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/java/wtf/beatrice/hidekobot/commands/slash/BotInfoCommand.java b/src/main/java/wtf/beatrice/hidekobot/commands/slash/BotInfoCommand.java index da2c79a..a692305 100644 --- a/src/main/java/wtf/beatrice/hidekobot/commands/slash/BotInfoCommand.java +++ b/src/main/java/wtf/beatrice/hidekobot/commands/slash/BotInfoCommand.java @@ -35,6 +35,9 @@ public class BotInfoCommand String botAvatarUrl = HidekoBot.getAPI().getSelfUser().getAvatarUrl(); if(botAvatarUrl != null) embedBuilder.setThumbnail(botAvatarUrl); + // help field + embedBuilder.addField("Getting started", "Type `/help` for help!", false); + // commands list field StringBuilder commandsListBuilder = new StringBuilder(); commandsListBuilder.append(registeredCommands.size()).append( " total - "); @@ -56,6 +59,8 @@ public class BotInfoCommand // jvm version field String jvmVersion = ManagementFactory.getRuntimeMXBean().getVmVersion(); + // only keep the important part "v19.0.1" and omit "v19.0.1+10" + jvmVersion = jvmVersion.replaceAll("\\+.*", ""); embedBuilder.addField("JVM Version", "v" + jvmVersion, true); // used ram field @@ -91,7 +96,6 @@ public class BotInfoCommand uptimeStringBuilder.append(minutes).append("m "); } } else { - uptimeStringBuilder.append(days).append("d "); uptimeStringBuilder.append(hours).append("h "); uptimeStringBuilder.append(minutes).append("m "); @@ -100,7 +104,10 @@ public class BotInfoCommand embedBuilder.addField("Uptime", uptimeStringBuilder.toString(), true); - + // issue tracker field + embedBuilder.addField("Support", + "[Issue tracker](https://git.beatrice.wtf/mind-overflow/HidekoBot)", + true); } event.getHook().editOriginalEmbeds(embedBuilder.build()).queue();