update number formatter

This commit is contained in:
Lee
2024-06-30 07:34:03 +01:00
parent 5aa56c2955
commit 729e0b482b
9 changed files with 107 additions and 57 deletions

View File

@ -1,5 +1,6 @@
package cc.fascinated.bat.service;
import cc.fascinated.bat.common.NumberFormatter;
import cc.fascinated.bat.common.TimerUtils;
import lombok.Getter;
import net.dv8tion.jda.api.JDA;
@ -26,10 +27,9 @@ public class DiscordService {
public static JDA JDA;
private final List<String> messages = List.of(
"over {guilds} guilds",
"over {users} users",
"over ScoreSaber scores",
"your messages",
"{guilds} guilds",
"{users} users",
"your ScoreSaber scores",
"/help for help"
);
@ -60,8 +60,8 @@ public class DiscordService {
public void updateActivity() {
int guildCount = JDA.getGuilds().size();
JDA.getPresence().setActivity(Activity.watching(messages.get(guildCount % messages.size())
.replace("{guilds}", String.valueOf(guildCount))
.replace("{users}", String.valueOf(JDA.getUsers().size()))
.replace("{guilds}", NumberFormatter.format(guildCount))
.replace("{users}", NumberFormatter.format(JDA.getUsers().size()))
));
}
}

View File

@ -12,9 +12,7 @@ import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.DependsOn;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**