public class WebhookAction extends AuditableRestAction<Webhook>
Webhook
Builder system created as an extension of RestAction
Webhooks
.AuditableRestAction.EmptyRestAction<T>
DEFAULT_FAILURE, DEFAULT_SUCCESS, LOG
Constructor | Description |
---|---|
WebhookAction(JDA api,
net.dv8tion.jda.core.requests.Route.CompiledRoute route,
java.lang.String name) |
Modifier and Type | Method | Description |
---|---|---|
okhttp3.RequestBody |
finalizeData() |
|
WebhookAction |
setAvatar(Icon icon) |
Sets the Avatar for the custom Webhook User
|
WebhookAction |
setCheck(java.util.function.BooleanSupplier checks) |
Sets the last-second checks before finally executing the http request in the queue.
|
WebhookAction |
setName(java.lang.String name) |
Sets the Name for the custom Webhook User
|
reason
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
complete, complete, completeAfter, getJDA, isPassContext, queue, queue, queue, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, setPassContext, submit, submit, submitAfter, submitAfter
public WebhookAction(JDA api, net.dv8tion.jda.core.requests.Route.CompiledRoute route, java.lang.String name)
@CheckReturnValue public WebhookAction setName(java.lang.String name)
name
- A not-null String name for the new Webhook user.java.lang.IllegalArgumentException
- If the specified name is not in the range of 2-100.public WebhookAction setCheck(java.util.function.BooleanSupplier checks)
RestAction
false
or throws an exception this will not be finished.
When an exception is thrown from the supplier it will be provided to the failure callback.setCheck
in class AuditableRestAction<Webhook>
checks
- The checks to run before executing the request, or null
to run no checks@CheckReturnValue public WebhookAction setAvatar(Icon icon)
icon
- An Icon
for the new avatar.
Or null to use default avatar.public okhttp3.RequestBody finalizeData()