Class WebhookAction
- java.lang.Object
-
- net.dv8tion.jda.core.requests.RestAction<T>
-
- net.dv8tion.jda.core.requests.restaction.AuditableRestAction<Webhook>
-
- net.dv8tion.jda.core.requests.restaction.WebhookAction
-
public class WebhookAction extends AuditableRestAction<Webhook>
Webhook
Builder system created as an extension ofRestAction
Provides an easy way to gather and deliver information to Discord to createWebhooks
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.dv8tion.jda.core.requests.restaction.AuditableRestAction
AuditableRestAction.EmptyRestAction<T>
-
-
Field Summary
-
Fields inherited from class net.dv8tion.jda.core.requests.RestAction
DEFAULT_FAILURE, DEFAULT_SUCCESS, LOG
-
-
Constructor Summary
Constructors Constructor Description WebhookAction(JDA api, net.dv8tion.jda.core.requests.Route.CompiledRoute route, java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description okhttp3.RequestBody
finalizeData()
WebhookAction
setAvatar(Icon icon)
Sets the Avatar for the custom Webhook UserWebhookAction
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-
Methods inherited from class net.dv8tion.jda.core.requests.restaction.AuditableRestAction
reason
-
Methods inherited from class net.dv8tion.jda.core.requests.RestAction
complete, complete, completeAfter, getJDA, isPassContext, queue, queue, queue, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, setPassContext, submit, submit, submitAfter, submitAfter
-
-
-
-
Constructor Detail
-
WebhookAction
public WebhookAction(JDA api, net.dv8tion.jda.core.requests.Route.CompiledRoute route, java.lang.String name)
-
-
Method Detail
-
setName
@CheckReturnValue public WebhookAction setName(java.lang.String name)
Sets the Name for the custom Webhook User- Parameters:
name
- A not-null String name for the new Webhook user.- Returns:
- The current WebhookAction for chaining convenience.
- Throws:
java.lang.IllegalArgumentException
- If the specified name is not in the range of 2-100.
-
setCheck
public WebhookAction setCheck(java.util.function.BooleanSupplier checks)
Description copied from class:RestAction
Sets the last-second checks before finally executing the http request in the queue.
If the provided supplier evaluates tofalse
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.- Overrides:
setCheck
in classAuditableRestAction<Webhook>
- Parameters:
checks
- The checks to run before executing the request, ornull
to run no checks- Returns:
- The current RestAction for chaining convenience
-
setAvatar
@CheckReturnValue public WebhookAction setAvatar(Icon icon)
Sets the Avatar for the custom Webhook User- Parameters:
icon
- AnIcon
for the new avatar. Or null to use default avatar.- Returns:
- The current WebhookAction for chaining convenience.
-
finalizeData
public okhttp3.RequestBody finalizeData()
-
-