Finish botinfo command
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
I don't know what else to add, and it looks nice now.
This commit is contained in:
parent
5e08cd748c
commit
996cedb154
@ -35,6 +35,9 @@ public class BotInfoCommand
|
|||||||
String botAvatarUrl = HidekoBot.getAPI().getSelfUser().getAvatarUrl();
|
String botAvatarUrl = HidekoBot.getAPI().getSelfUser().getAvatarUrl();
|
||||||
if(botAvatarUrl != null) embedBuilder.setThumbnail(botAvatarUrl);
|
if(botAvatarUrl != null) embedBuilder.setThumbnail(botAvatarUrl);
|
||||||
|
|
||||||
|
// help field
|
||||||
|
embedBuilder.addField("Getting started", "Type `/help` for help!", false);
|
||||||
|
|
||||||
// commands list field
|
// commands list field
|
||||||
StringBuilder commandsListBuilder = new StringBuilder();
|
StringBuilder commandsListBuilder = new StringBuilder();
|
||||||
commandsListBuilder.append(registeredCommands.size()).append( " total - ");
|
commandsListBuilder.append(registeredCommands.size()).append( " total - ");
|
||||||
@ -56,6 +59,8 @@ public class BotInfoCommand
|
|||||||
|
|
||||||
// jvm version field
|
// jvm version field
|
||||||
String jvmVersion = ManagementFactory.getRuntimeMXBean().getVmVersion();
|
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);
|
embedBuilder.addField("JVM Version", "v" + jvmVersion, true);
|
||||||
|
|
||||||
// used ram field
|
// used ram field
|
||||||
@ -91,7 +96,6 @@ public class BotInfoCommand
|
|||||||
uptimeStringBuilder.append(minutes).append("m ");
|
uptimeStringBuilder.append(minutes).append("m ");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
uptimeStringBuilder.append(days).append("d ");
|
uptimeStringBuilder.append(days).append("d ");
|
||||||
uptimeStringBuilder.append(hours).append("h ");
|
uptimeStringBuilder.append(hours).append("h ");
|
||||||
uptimeStringBuilder.append(minutes).append("m ");
|
uptimeStringBuilder.append(minutes).append("m ");
|
||||||
@ -100,7 +104,10 @@ public class BotInfoCommand
|
|||||||
|
|
||||||
embedBuilder.addField("Uptime", uptimeStringBuilder.toString(), true);
|
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();
|
event.getHook().editOriginalEmbeds(embedBuilder.build()).queue();
|
||||||
|
Loading…
Reference in New Issue
Block a user