java.lang.Object
io.github._4drian3d.jdwebhooks.WebHookClient
An object capable of sending requests to publish WebHooks in a given Discord channel.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder for the creation of a new WebHookClient. -
Method Summary
Modifier and TypeMethodDescriptionstatic WebHookClient.Builderbuilder()Get a builder for the creation of a new WebHookClient.static WebHookClientCreates a new WebHookClient based on its id and token.static WebHookClientCreates a new WebHookClient based on aURI.sendWebHook(@NotNull WebHook webHook) Sends the specified WebHook.
-
Method Details
-
builder
Get a builder for the creation of a new WebHookClient.
It is recommended to use a builder instead of the static factory to be able to configure a user agent corresponding to your application.- Returns:
- a new WebHookClient Builder
-
fromURL
Creates a new WebHookClient based on aURI.- Parameters:
uri- the webhook url provided- Returns:
- a new WebHookClient
- Throws:
IllegalArgumentException- if the provided URL is invalid
-
from
Creates a new WebHookClient based on its id and token.- Parameters:
id- the webhook idtoken- the webhook token- Returns:
- a new WebHookClient
- Throws:
IllegalArgumentException- if the provided id or token are is invalid- See Also:
-
sendWebHook
Sends the specified WebHook.- Parameters:
webHook- the webhook to send- Returns:
- a CompletableFuture with the result of this request
-