fix help command
All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 42s

This commit is contained in:
Lee
2024-06-27 21:21:56 +01:00
parent deb656086a
commit ff5b83f531
3 changed files with 21 additions and 4 deletions

View File

@ -110,7 +110,7 @@ public class HelpCommand extends BatCommand implements EventListener {
*/
private MessageEmbed createHomeEmbed() {
String categories = "";
for (Category category : Category.values()) {
for (Category category : Category.getCategories()) {
long commandCount = commandService.getCommandsByCategory(category, true).size();
categories += "➜ %s - **%s Command%s**\n".formatted(
category.getName(),
@ -132,7 +132,7 @@ public class HelpCommand extends BatCommand implements EventListener {
private LayoutComponent[] createHomeActions() {
List<SelectOption> options = new ArrayList<>();
options.add(SelectOption.of("Home", "home").withEmoji(Emoji.fromUnicode("U+1F3E0")));
options.addAll(Arrays.stream(Category.values()).map(category ->
options.addAll(Category.getCategories().stream().map(category ->
SelectOption.of(category.getName(), category.getName()).withEmoji(category.getEmoji()))
.toList());