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