@FunctionalInterface public interface AsyncSuggestionProvider<A extends CommandActor> extends BaseSuggestionProvider
Note: The ability to provide asynchronous completions is platform-dependent.
In platforms where such behavior is unsupported, Lamp will fall back to
normal completions, and getSuggestionsAsync(ExecutionContext) will
block.
| Modifier and Type | Method and Description |
|---|---|
static <A extends CommandActor> |
from(@NotNull SuggestionProvider<A> provider)
Creates a
AsyncSuggestionProvider from the given SuggestionProvider |
@NotNull java.util.concurrent.CompletableFuture<java.util.Collection<java.lang.String>> |
getSuggestionsAsync(@NotNull ExecutionContext<A> context)
Returns the suggestions
|
@NotNull static <A extends CommandActor> @NotNull AsyncSuggestionProvider<A> from(@NotNull @NotNull SuggestionProvider<A> provider)
AsyncSuggestionProvider from the given SuggestionProviderA - The actor typeprovider - Provider to wrapAsyncSuggestionProvider@NotNull
@NotNull java.util.concurrent.CompletableFuture<java.util.Collection<java.lang.String>> getSuggestionsAsync(@NotNull
@NotNull ExecutionContext<A> context)
context - The execution context. This will try to parse
arguments inputted by the user and store them
to provide context-aware suggestions.