Skip to content

Commit

Permalink
fix select menu with only one option crashing
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaktushose committed Jan 18, 2025
1 parent 6af2cb9 commit 5e711b8
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ public static Optional<StringSelectMenuDefinition> build(MethodBuildContext cont
}

Set<SelectOptionDefinition> selectOptions = new HashSet<>();

method.annotations().stream()
.filter(com.github.kaktushose.jda.commands.annotations.interactions.SelectOption.class::isInstance)
.map(com.github.kaktushose.jda.commands.annotations.interactions.SelectOption.class::cast)
.forEach(it -> selectOptions.add(SelectOptionDefinition.build(it)));

method.annotations().stream()
.filter(SelectOptionContainer.class::isInstance)
.map(SelectOptionContainer.class::cast)
Expand Down

0 comments on commit 5e711b8

Please sign in to comment.