public class JavacordWebhookClient extends WebhookClient
WebhookClient.BucketallowedMentions, bucket, client, defaultTimeout, id, isQueued, isShutdown, parent, parseMessage, pool, queue, threadId, url, USER_AGENT, WEBHOOK_URL| Modifier | Constructor and Description |
|---|---|
protected |
JavacordWebhookClient(JavacordWebhookClient parent,
long threadId) |
|
JavacordWebhookClient(long id,
java.lang.String token,
boolean parseMessage,
okhttp3.OkHttpClient client,
java.util.concurrent.ScheduledExecutorService pool,
AllowedMentions mentions) |
|
JavacordWebhookClient(long id,
java.lang.String token,
boolean parseMessage,
okhttp3.OkHttpClient client,
java.util.concurrent.ScheduledExecutorService pool,
AllowedMentions mentions,
long threadId) |
| Modifier and Type | Method and Description |
|---|---|
@NotNull java.util.concurrent.CompletableFuture<ReadonlyMessage> |
edit(long messageId,
org.javacord.api.entity.message.embed.Embed embed)
Edits the target message with the provided
Embed to the webhook. |
@NotNull java.util.concurrent.CompletableFuture<ReadonlyMessage> |
edit(long messageId,
org.javacord.api.entity.message.Message message)
Edits the target message with the provided
Message to the webhook. |
@NotNull java.util.concurrent.CompletableFuture<ReadonlyMessage> |
edit(@NotNull java.lang.String messageId,
org.javacord.api.entity.message.embed.Embed embed)
Edits the target message with the provided
Embed to the webhook. |
@NotNull java.util.concurrent.CompletableFuture<ReadonlyMessage> |
edit(@NotNull java.lang.String messageId,
org.javacord.api.entity.message.Message message)
Edits the target message with the provided
Message to the webhook. |
static @NotNull JavacordWebhookClient |
from(org.javacord.api.entity.webhook.Webhook webhook)
Creates a WebhookClient for the provided webhook.
|
@NotNull JavacordWebhookClient |
onThread(long threadId)
Returns a wrapper of this WebhookClient that targets the specified thread.
|
@NotNull java.util.concurrent.CompletableFuture<ReadonlyMessage> |
send(org.javacord.api.entity.message.embed.Embed embed)
Sends the provided
Embed to the webhook. |
@NotNull java.util.concurrent.CompletableFuture<ReadonlyMessage> |
send(org.javacord.api.entity.message.Message message)
Sends the provided
Message to the webhook. |
static @NotNull JavacordWebhookClient |
withId(long id,
@NotNull java.lang.String token)
Factory method to create a basic JavacordWebhookClient with the provided id and token.
|
static @NotNull JavacordWebhookClient |
withUrl(@NotNull java.lang.String url)
Factory method to create a basic JavacordWebhookClient with the provided id and token.
|
backoffQueue, checkShutdown, close, delete, delete, drainQueue, edit, edit, edit, edit, edit, edit, edit, edit, execute, execute, failure, get, get, getId, getThreadId, getTimeout, getUrl, isShutdown, isWait, newBody, newRequest, queueRequest, schedule, send, send, send, send, send, send, send, send, setTimeoutpublic JavacordWebhookClient(long id,
java.lang.String token,
boolean parseMessage,
okhttp3.OkHttpClient client,
java.util.concurrent.ScheduledExecutorService pool,
AllowedMentions mentions)
public JavacordWebhookClient(long id,
java.lang.String token,
boolean parseMessage,
okhttp3.OkHttpClient client,
java.util.concurrent.ScheduledExecutorService pool,
AllowedMentions mentions,
long threadId)
protected JavacordWebhookClient(JavacordWebhookClient parent, long threadId)
@NotNull public static @NotNull JavacordWebhookClient from(@NotNull org.javacord.api.entity.webhook.Webhook webhook)
You can use onThread(long) to target specific threads on the channel.
webhook - The webhookjava.lang.NullPointerException - If the webhook is null or does not provide a token@NotNull public static @NotNull JavacordWebhookClient withId(long id, @NotNull @NotNull java.lang.String token)
You can use onThread(long) to target specific threads on the channel.
id - The webhook idtoken - The webhook tokenjava.lang.NullPointerException - If provided with null@NotNull public static @NotNull JavacordWebhookClient withUrl(@NotNull @NotNull java.lang.String url)
You can use onThread(long) to target specific threads on the channel.
url - The url for the webhookjava.lang.NullPointerException - If provided with nulljava.lang.NumberFormatException - If no valid id is part o the url@NotNull public @NotNull JavacordWebhookClient onThread(long threadId)
WebhookClientThe returned webhook client inherits all the settings (including the thread pool) from this client instance. If either of the clients is shutdown/closed, the other instance will no longer send any messages.
onThread in class WebhookClientthreadId - The target thread id, or 0 to send directly to the parent channel@NotNull public @NotNull java.util.concurrent.CompletableFuture<ReadonlyMessage> send(@NotNull org.javacord.api.entity.message.Message message)
Message to the webhook.message - The message to sendCompletableFuturejava.lang.NullPointerException - If null is providedWebhookClient.isWait(),
WebhookMessageBuilder.fromJavacord(org.javacord.api.entity.message.Message)@NotNull public @NotNull java.util.concurrent.CompletableFuture<ReadonlyMessage> send(@NotNull org.javacord.api.entity.message.embed.Embed embed)
Embed to the webhook.embed - The embed to sendCompletableFuturejava.lang.NullPointerException - If null is providedWebhookClient.isWait(),
WebhookEmbedBuilder.fromJavacord(org.javacord.api.entity.message.embed.Embed)@NotNull public @NotNull java.util.concurrent.CompletableFuture<ReadonlyMessage> edit(long messageId, @NotNull org.javacord.api.entity.message.Message message)
Message to the webhook.messageId - The target message idmessage - The message to sendCompletableFuturejava.lang.NullPointerException - If null is providedWebhookClient.isWait(),
WebhookMessageBuilder.fromJavacord(org.javacord.api.entity.message.Message)@NotNull public @NotNull java.util.concurrent.CompletableFuture<ReadonlyMessage> edit(long messageId, @NotNull org.javacord.api.entity.message.embed.Embed embed)
Embed to the webhook.messageId - The target message idembed - The embed to sendCompletableFuturejava.lang.NullPointerException - If null is providedWebhookClient.isWait(),
WebhookEmbedBuilder.fromJavacord(org.javacord.api.entity.message.embed.Embed)@NotNull public @NotNull java.util.concurrent.CompletableFuture<ReadonlyMessage> edit(@NotNull @NotNull java.lang.String messageId, @NotNull org.javacord.api.entity.message.Message message)
Message to the webhook.messageId - The target message idmessage - The message to sendCompletableFuturejava.lang.NullPointerException - If null is providedWebhookClient.isWait(),
WebhookMessageBuilder.fromJavacord(org.javacord.api.entity.message.Message)@NotNull public @NotNull java.util.concurrent.CompletableFuture<ReadonlyMessage> edit(@NotNull @NotNull java.lang.String messageId, @NotNull org.javacord.api.entity.message.embed.Embed embed)
Embed to the webhook.messageId - The target message idembed - The embed to sendCompletableFuturejava.lang.NullPointerException - If null is providedWebhookClient.isWait(),
WebhookEmbedBuilder.fromJavacord(org.javacord.api.entity.message.embed.Embed)