Skip to content

Commit

Permalink
fix string select options not registering
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaktushose committed Jan 10, 2025
1 parent 3d02a61 commit 694f657
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.github.kaktushose.jda.commands.definitions.interactions.component.menu;

import com.github.kaktushose.jda.commands.annotations.internal.SelectOptionContainer;
import com.github.kaktushose.jda.commands.definitions.Definition;
import com.github.kaktushose.jda.commands.definitions.description.ClassDescription;
import com.github.kaktushose.jda.commands.definitions.description.MethodDescription;
Expand Down Expand Up @@ -50,11 +51,10 @@ 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));
});
.filter(SelectOptionContainer.class::isInstance)
.map(SelectOptionContainer.class::cast)
.flatMap(it -> Arrays.stream(it.value()))
.forEach(it -> selectOptions.add(SelectOptionDefinition.build(it)));

return Optional.of(new StringSelectMenuDefinition(
context.clazz(),
Expand Down

0 comments on commit 694f657

Please sign in to comment.