Package dev.unnm3d.redischat.utils
Class AdventureWebuiEditorAPI
java.lang.Object
dev.unnm3d.redischat.utils.AdventureWebuiEditorAPI
The adventure-webui editor API.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance of the editor API.AdventureWebuiEditorAPI
(@NotNull URI root, @NotNull HttpClient client) Creates a new instance of the editor API with the given root URI and a client. -
Method Summary
Modifier and TypeMethodDescriptiongetEditorUrl
(String token) @NotNull CompletableFuture
<String> retrieveSession
(@NotNull String token) Retrieves the result of a session, given a token.@NotNull CompletableFuture
<String> startSession
(@NotNull String input, @NotNull String command, @NotNull String application) Starts a session, returning the token.
-
Constructor Details
-
AdventureWebuiEditorAPI
Creates a new instance of the editor API. -
AdventureWebuiEditorAPI
Creates a new instance of the editor API with the given root URI and a client.- Parameters:
root
- the root URIclient
- the client
-
-
Method Details
-
startSession
@NotNull public @NotNull CompletableFuture<String> startSession(@NotNull @NotNull String input, @NotNull @NotNull String command, @NotNull @NotNull String application) Starts a session, returning the token.- Parameters:
input
- the inputcommand
- the commandapplication
- the application name- Returns:
- a completable future that will provide the token
-
retrieveSession
Retrieves the result of a session, given a token.- Parameters:
token
- the token- Returns:
- the resulting MiniMessage string in a completable future
-
getEditorUrl
-