cleanup and acc country flag to ss me and user command
All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 36s
All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 36s
This commit is contained in:
@ -44,7 +44,7 @@ public class HelpCommand extends BatCommand implements EventListener {
|
||||
public void execute(BatGuild guild, @NonNull BatUser user, @NonNull MessageChannel channel, Member member, @NonNull SlashCommandInteraction interaction) {
|
||||
String categories = "";
|
||||
for (Category category : Category.values()) {
|
||||
long commandCount = commandService.getCommands().values().stream().filter(command -> command.getCategory() == category).count();
|
||||
long commandCount = commandService.getCommandsByCategory(category).size();
|
||||
categories += "**%s** - %s Commands\n".formatted(category.getName(), commandCount);
|
||||
}
|
||||
|
||||
@ -76,9 +76,7 @@ public class HelpCommand extends BatCommand implements EventListener {
|
||||
}
|
||||
|
||||
String commands = "";
|
||||
List<BatCommand> categoryCommands = commandService.getCommands().values().stream()
|
||||
.filter(command -> command.getCategory() == category)
|
||||
.toList();
|
||||
List<BatCommand> categoryCommands = commandService.getCommandsByCategory(category);
|
||||
if (categoryCommands.isEmpty()) {
|
||||
commands = "No commands available in this category.";
|
||||
} else {
|
||||
@ -105,7 +103,7 @@ public class HelpCommand extends BatCommand implements EventListener {
|
||||
}
|
||||
|
||||
event.editMessageEmbeds(EmbedUtils.genericEmbed()
|
||||
.setDescription("The available commands in the **%s** category: \n\n%s".formatted(category.getName(), commands))
|
||||
.setDescription("There is %S commands in the **%s** category: \n\n%s".formatted(categoryCommands.size(), category.getName(), commands))
|
||||
.build()).queue();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user