Compare commits
No commits in common. "5e08cd748ca21232493b901094d9b2e2526c5348" and "79c8f1a95ea735fc3aec52534733887b2f6593ca" have entirely different histories.
5e08cd748c
...
79c8f1a95e
@ -10,7 +10,7 @@ java -jar HidekoBot.jar <botToken> [additional parameters]
|
|||||||
Where `HidekoBot.jar` is the executable archive and `<botToken>` is your bot token passed as an argument.
|
Where `HidekoBot.jar` is the executable archive and `<botToken>` is your bot token passed as an argument.
|
||||||
|
|
||||||
Additionally available parameters are:
|
Additionally available parameters are:
|
||||||
- **verbose**: log every message that the bot receives, plus additional debugging messages. Very spammy and performance heavy.
|
- **verbose**: log every message that the bot receives. Very spammy and performance heavy.
|
||||||
- **refresh**: force refresh the bot's commands.
|
- **refresh**: force refresh the bot's commands.
|
||||||
|
|
||||||
*Note: Java 16 or later is required.*
|
*Note: Java 16 or later is required.*
|
||||||
|
@ -72,33 +72,8 @@ public class BotInfoCommand
|
|||||||
LocalDateTime now = LocalDateTime.now();
|
LocalDateTime now = LocalDateTime.now();
|
||||||
long uptimeSeconds = ChronoUnit.SECONDS.between(Configuration.getStartupTime(), now);
|
long uptimeSeconds = ChronoUnit.SECONDS.between(Configuration.getStartupTime(), now);
|
||||||
Duration uptime = Duration.ofSeconds(uptimeSeconds);
|
Duration uptime = Duration.ofSeconds(uptimeSeconds);
|
||||||
long seconds = uptime.toSecondsPart();
|
uptime.toDaysPart() // todo
|
||||||
long minutes = uptime.toMinutesPart();
|
embedBuilder.addField("Uptime", "seconds: " + uptime, true);
|
||||||
long hours = uptime.toHoursPart();
|
|
||||||
long days = uptime.toDays();
|
|
||||||
|
|
||||||
StringBuilder uptimeStringBuilder = new StringBuilder();
|
|
||||||
if(days == 0)
|
|
||||||
{
|
|
||||||
if(hours == 0)
|
|
||||||
{
|
|
||||||
if(minutes == 0)
|
|
||||||
{} else {
|
|
||||||
uptimeStringBuilder.append(minutes).append("m ");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
uptimeStringBuilder.append(hours).append("h ");
|
|
||||||
uptimeStringBuilder.append(minutes).append("m ");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
|
|
||||||
uptimeStringBuilder.append(days).append("d ");
|
|
||||||
uptimeStringBuilder.append(hours).append("h ");
|
|
||||||
uptimeStringBuilder.append(minutes).append("m ");
|
|
||||||
}
|
|
||||||
uptimeStringBuilder.append(seconds).append("s ");
|
|
||||||
|
|
||||||
embedBuilder.addField("Uptime", uptimeStringBuilder.toString(), true);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user