Add list alias

This commit is contained in:
Badbird5907
2023-01-05 19:44:41 -05:00
parent 7d83b1f8f2
commit f68a728f85

View File

@@ -235,8 +235,11 @@ public class BotCommand extends CommandInstance {
}
@Command(
name = "count",
desc = "Counts the amount of bots on screen by name."
name = "count",
desc = "Counts the amount of bots on screen by name.",
aliases = {
"list"
}
)
public void count(CommandSender sender) {
List<String> names = manager.fetchNames();
@@ -244,7 +247,7 @@ public class BotCommand extends CommandInstance {
List<Entry<String, Integer>> entries = freqMap.entrySet().stream()
.sorted(Map.Entry.comparingByValue(Comparator.reverseOrder())).collect(Collectors.toList());
sender.sendMessage(ChatUtils.LINE);
sender.sendMessage(ChatUtils.LINE);
entries.forEach(en -> sender.sendMessage(ChatColor.GREEN + en.getKey()
+ ChatColor.RESET + " - " + ChatColor.BLUE + en.getValue().toString() + ChatColor.RESET));
sender.sendMessage("Total bots: " + ChatColor.BLUE + freqMap.values().stream().reduce(0, Integer::sum) + ChatColor.RESET);