public class JDAWebhookClient 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 |
JDAWebhookClient(JDAWebhookClient parent,
long threadId) |
|
JDAWebhookClient(long id,
java.lang.String token,
boolean parseMessage,
okhttp3.OkHttpClient client,
java.util.concurrent.ScheduledExecutorService pool,
AllowedMentions mentions) |
|
JDAWebhookClient(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,
net.dv8tion.jda.api.entities.Message message)
Edits the target message with the provided
Message to the webhook. |
@NotNull java.util.concurrent.CompletableFuture<ReadonlyMessage> |
edit(long messageId,
net.dv8tion.jda.api.entities.MessageEmbed embed)
Edits the target message with the provided
MessageEmbed to the webhook. |
@NotNull java.util.concurrent.CompletableFuture<ReadonlyMessage> |
edit(@NotNull java.lang.String messageId,
net.dv8tion.jda.api.entities.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,
net.dv8tion.jda.api.entities.MessageEmbed embed)
Edits the target message with the provided
MessageEmbed to the webhook. |
static @NotNull JDAWebhookClient |
from(net.dv8tion.jda.api.entities.Webhook webhook)
Creates a WebhookClient for the provided webhook.
|
@NotNull JDAWebhookClient |
onThread(long threadId)
Returns a wrapper of this WebhookClient that targets the specified thread.
|
@NotNull java.util.concurrent.CompletableFuture<ReadonlyMessage> |
send(net.dv8tion.jda.api.entities.Message message)
Sends the provided
Message to the webhook. |
@NotNull java.util.concurrent.CompletableFuture<ReadonlyMessage> |
send(net.dv8tion.jda.api.entities.MessageEmbed embed)
Sends the provided
MessageEmbed to the webhook. |
static @NotNull JDAWebhookClient |
withId(long id,
@NotNull java.lang.String token)
Factory method to create a basic JDAWebhookClient with the provided id and token.
|
static @NotNull JDAWebhookClient |
withUrl(@NotNull java.lang.String url)
Factory method to create a basic JDAWebhookClient 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 JDAWebhookClient(long id,
java.lang.String token,
boolean parseMessage,
okhttp3.OkHttpClient client,
java.util.concurrent.ScheduledExecutorService pool,
AllowedMentions mentions)
public JDAWebhookClient(long id,
java.lang.String token,
boolean parseMessage,
okhttp3.OkHttpClient client,
java.util.concurrent.ScheduledExecutorService pool,
AllowedMentions mentions,
long threadId)
protected JDAWebhookClient(JDAWebhookClient parent, long threadId)
@NotNull public static @NotNull JDAWebhookClient from(@NotNull net.dv8tion.jda.api.entities.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 JDAWebhookClient 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 JDAWebhookClient 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 JDAWebhookClient 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 net.dv8tion.jda.api.entities.Message message)
Message to the webhook.message - The message to sendCompletableFuturejava.lang.NullPointerException - If null is providedWebhookClient.isWait(),
WebhookMessageBuilder.fromJDA(Message)@NotNull public @NotNull java.util.concurrent.CompletableFuture<ReadonlyMessage> send(@NotNull net.dv8tion.jda.api.entities.MessageEmbed embed)
MessageEmbed to the webhook.embed - The embed to sendCompletableFuturejava.lang.NullPointerException - If null is providedWebhookClient.isWait(),
WebhookEmbedBuilder.fromJDA(net.dv8tion.jda.api.entities.MessageEmbed)@NotNull public @NotNull java.util.concurrent.CompletableFuture<ReadonlyMessage> edit(long messageId, @NotNull net.dv8tion.jda.api.entities.Message message)
Message to the webhook.messageId - The target message idmessage - The message to sendCompletableFuturejava.lang.NullPointerException - If null is providedWebhookClient.isWait(),
WebhookMessageBuilder.fromJDA(Message)@NotNull public @NotNull java.util.concurrent.CompletableFuture<ReadonlyMessage> edit(long messageId, @NotNull net.dv8tion.jda.api.entities.MessageEmbed embed)
MessageEmbed to the webhook.messageId - The target message idembed - The embed to sendCompletableFuturejava.lang.NullPointerException - If null is providedWebhookClient.isWait(),
WebhookEmbedBuilder.fromJDA(net.dv8tion.jda.api.entities.MessageEmbed)@NotNull public @NotNull java.util.concurrent.CompletableFuture<ReadonlyMessage> edit(@NotNull @NotNull java.lang.String messageId, @NotNull net.dv8tion.jda.api.entities.Message message)
Message to the webhook.messageId - The target message idmessage - The message to sendCompletableFuturejava.lang.NullPointerException - If null is providedWebhookClient.isWait(),
WebhookMessageBuilder.fromJDA(Message)@NotNull public @NotNull java.util.concurrent.CompletableFuture<ReadonlyMessage> edit(@NotNull @NotNull java.lang.String messageId, @NotNull net.dv8tion.jda.api.entities.MessageEmbed embed)
MessageEmbed to the webhook.messageId - The target message idembed - The embed to sendCompletableFuturejava.lang.NullPointerException - If null is providedWebhookClient.isWait(),
WebhookEmbedBuilder.fromJDA(net.dv8tion.jda.api.entities.MessageEmbed)