Package xyz.dynxsty.dih4jda.util
Class AutoCompleteUtils
java.lang.Object
xyz.dynxsty.dih4jda.util.AutoCompleteUtils
Utility class that contains some useful methods regarding the AutoComplete system.
- Since:
- v1.4
-
Method Summary
Modifier and TypeMethodDescriptionstatic List<net.dv8tion.jda.api.interactions.commands.Command.Choice>filterChoices(String filter, List<net.dv8tion.jda.api.interactions.commands.Command.Choice> choices) Filters all AutoComplete choices based on the user's current input.static List<net.dv8tion.jda.api.interactions.commands.Command.Choice>filterChoices(String filter, net.dv8tion.jda.api.interactions.commands.Command.Choice... choices) Filters all AutoComplete choices based on the user's current input.static List<net.dv8tion.jda.api.interactions.commands.Command.Choice>filterChoices(net.dv8tion.jda.api.events.interaction.command.CommandAutoCompleteInteractionEvent event, List<net.dv8tion.jda.api.interactions.commands.Command.Choice> choices) Filters all AutoComplete choices based on the user's current input.static List<net.dv8tion.jda.api.interactions.commands.Command.Choice>filterChoices(net.dv8tion.jda.api.events.interaction.command.CommandAutoCompleteInteractionEvent event, net.dv8tion.jda.api.interactions.commands.Command.Choice... choices) Filters all AutoComplete choices based on the user's current input.
-
Method Details
-
filterChoices
@Nonnull public static List<net.dv8tion.jda.api.interactions.commands.Command.Choice> filterChoices(@Nonnull net.dv8tion.jda.api.events.interaction.command.CommandAutoCompleteInteractionEvent event, @Nonnull List<net.dv8tion.jda.api.interactions.commands.Command.Choice> choices) Filters all AutoComplete choices based on the user's current input.return event.replyChoices(AutoCompleteUtils.filterChoices(event, choices)); -
filterChoices
@Nonnull public static List<net.dv8tion.jda.api.interactions.commands.Command.Choice> filterChoices(@Nonnull net.dv8tion.jda.api.events.interaction.command.CommandAutoCompleteInteractionEvent event, @Nonnull net.dv8tion.jda.api.interactions.commands.Command.Choice... choices) Filters all AutoComplete choices based on the user's current input.return event.replyChoices(AutoCompleteUtils.filterChoices(event, choices));- Parameters:
event- TheCommandAutoCompleteInteractionEventthat was fired.choices- An array ofCommand.Choices.- Returns:
- The filtered
ListofCommand.Choices. - Since:
- v1.4
-
filterChoices
@Nonnull public static List<net.dv8tion.jda.api.interactions.commands.Command.Choice> filterChoices(@Nonnull String filter, @Nonnull List<net.dv8tion.jda.api.interactions.commands.Command.Choice> choices) Filters all AutoComplete choices based on the user's current input.return event.replyChoices(AutoCompleteUtils.filterChoices("abc", choices)); -
filterChoices
@Nonnull public static List<net.dv8tion.jda.api.interactions.commands.Command.Choice> filterChoices(@Nonnull String filter, @Nonnull net.dv8tion.jda.api.interactions.commands.Command.Choice... choices) Filters all AutoComplete choices based on the user's current input.return event.replyChoices(AutoCompleteUtils.filterChoices("abc", choices));
-