diff --git a/litecommands-jda/src/dev/rollczi/litecommands/jda/JDAPlatform.java b/litecommands-jda/src/dev/rollczi/litecommands/jda/JDAPlatform.java index 984e481b..4eabf3d5 100644 --- a/litecommands-jda/src/dev/rollczi/litecommands/jda/JDAPlatform.java +++ b/litecommands-jda/src/dev/rollczi/litecommands/jda/JDAPlatform.java @@ -20,6 +20,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import net.dv8tion.jda.api.interactions.commands.build.OptionData; import org.jetbrains.annotations.Nullable; class JDAPlatform extends AbstractPlatform { @@ -138,7 +139,8 @@ public void onCommandAutoCompleteInteraction(CommandAutoCompleteInteractionEvent List choiceList = result.getSuggestions().stream() .filter(suggestion -> !suggestion.multilevel().isEmpty()) .map(suggestion -> choice(event.getFocusedOption().getType(), suggestion)) - .filter(Objects::nonNull) + .filter(choice -> Objects.nonNull(choice)) + .limit(OptionData.MAX_CHOICES) .collect(Collectors.toList()); event.replyChoices(choiceList).queue();