+ * Example: 1000 -> 1,000 | Example: 1000.5 -> 1,000.5 + *
* * @param number the number to format * @return the formatted number */ public static String formatNumberCommas(double number) { - return String.format("%,.0f", number); + NumberFormat format = NumberFormat.getNumberInstance(); + format.setGroupingUsed(true); + return format.format(number); } } diff --git a/src/main/java/cc/fascinated/bat/service/CommandService.java b/src/main/java/cc/fascinated/bat/service/CommandService.java index 3bff266..6e69402 100644 --- a/src/main/java/cc/fascinated/bat/service/CommandService.java +++ b/src/main/java/cc/fascinated/bat/service/CommandService.java @@ -98,13 +98,7 @@ public class CommandService extends ListenerAdapter { }); // Register all commands - for (BatCommand command : commands.values()) { - if (command.getCommandData() == null) { - continue; - } - - jda.upsertCommand(command.getCommandData()).complete(); // Register the command on Discord - } + jda.updateCommands().addCommands(commands.values().stream().map(BatCommand::getCommandData).toList()).complete(); log.info("Registered all slash commands in {}ms", System.currentTimeMillis() - before); } diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 9dcfa00..4235a83 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -10,5 +10,5 @@ spring: # MongoDB Configuration mongodb: uri: "mongodb://bat:p4$$w0rd@localhost:27017" - database: "bonfire" + database: "bat" auto-index-creation: true # Automatically create collection indexes diff --git a/src/test/java/cc/fascinated/bat/BatApplicationTests.java b/src/test/java/cc/fascinated/bat/BatApplicationTests.java deleted file mode 100644 index dc2257f..0000000 --- a/src/test/java/cc/fascinated/bat/BatApplicationTests.java +++ /dev/null @@ -1,13 +0,0 @@ -package cc.fascinated.bat; - -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.context.SpringBootTest; - -@SpringBootTest -class BatApplicationTests { - - @Test - void contextLoads() { - } - -}