Compare commits

...

2 Commits

Author SHA1 Message Date
Bea 78bdadad06 Add info about random.org
continuous-integration/drone/push Build is passing Details
2023-01-15 23:02:41 +01:00
Bea a5b9f9d993 Add basic development info to readme 2023-01-15 23:02:13 +01:00
3 changed files with 30 additions and 12 deletions

View File

@ -38,4 +38,11 @@ commands support both systems, but some of them are limited in one way or anothe
The bot currently supports SQLite as a database backend. A database file will be created after the first boot
in your current directory. Do not delete the database file to avoid corruption and unpredictable
behavior.
behavior.
# Development
## Versioning
This project uses the `x.y.z-releaseType` schema for releases.
Development builds are tagged as `x.y.z-SNAPSHOT` and sometimes pushed to the snapshots Maven repository.
Stable builds are tagged as `x.y.z` and always pushed to the releases Maven repository, by promoting the build on
[Drone](https://drone.beatrice.wtf/). Currently, promoting stable builds is a manual process.

View File

@ -6,7 +6,7 @@
<groupId>wtf.beatrice.hidekobot</groupId>
<artifactId>HidekoBot</artifactId>
<version>0.5.18</version>
<version>0.5.19-SNAPSHOT</version>
<properties>
<maven.compiler.source>16</maven.compiler.source>

View File

@ -5,6 +5,7 @@ import net.dv8tion.jda.api.entities.MessageEmbed;
import wtf.beatrice.hidekobot.Cache;
import wtf.beatrice.hidekobot.HidekoBot;
import wtf.beatrice.hidekobot.util.FormatUtil;
import wtf.beatrice.hidekobot.util.RandomUtil;
import java.lang.management.ManagementFactory;
import java.text.DecimalFormat;
@ -48,25 +49,35 @@ public class BotInfo
// keep track of how many total commands we have
int commandsCount = 0;
// message commands info fields
StringBuilder messageCommandsInfoBuilder = new StringBuilder();
// message commands info field
String messageCommandsInfo;
if(Cache.getMessageCommandListener() == null)
messageCommandsInfoBuilder.append("❌ disabled");
messageCommandsInfo = "❌ disabled";
else {
messageCommandsInfoBuilder.append("✅ available");
messageCommandsInfo = "✅ available";
commandsCount += Cache.getMessageCommandListener().getRegisteredCommands().size();
}
embedBuilder.addField("Message commands", messageCommandsInfoBuilder.toString(), true);
embedBuilder.addField("Message commands", messageCommandsInfo, true);
// slash commands info fields
StringBuilder slashCommandsInfoBuilder = new StringBuilder();
// slash commands info field
String slashCommandsInfo;
if(Cache.getMessageCommandListener() == null)
slashCommandsInfoBuilder.append("❌ disabled");
slashCommandsInfo = "❌ disabled";
else {
slashCommandsInfoBuilder.append("✅ available");
slashCommandsInfo = "✅ available";
commandsCount += Cache.getSlashCommandListener().getRegisteredCommands().size();
}
embedBuilder.addField("Slash commands", slashCommandsInfoBuilder.toString(), true);
embedBuilder.addField("Slash commands", slashCommandsInfo, true);
// random.org integration field
String randomOrgInfo;
if(RandomUtil.isRandomOrgKeyValid())
{
randomOrgInfo = "✅ connected";
} else {
randomOrgInfo = "❌ disabled";
}
embedBuilder.addField("Random.org", randomOrgInfo, true);
// commands count fields
embedBuilder.addField("Total commands", "Loaded: `" + commandsCount + "`", true);