Interface AbstractWebhookMessageAction<T,R extends AbstractWebhookMessageAction<T,R>>
- Type Parameters:
T
- The result typeR
- The action type
- All Superinterfaces:
FluentRestAction<T,
,R> RestAction<T>
- All Known Subinterfaces:
WebhookMessageCreateAction<T>
,WebhookMessageDeleteAction
,WebhookMessageEditAction<T>
,WebhookMessageRetrieveAction
public interface AbstractWebhookMessageAction<T,R extends AbstractWebhookMessageAction<T,R>>
extends FluentRestAction<T,R>
Abstraction for requests related to webhook executions.
This adds the ability to change the context in which the webhook is used, by setting a
This adds the ability to change the context in which the webhook is used, by setting a
thread id
.-
Method Summary
Modifier and TypeMethodDescriptiondefault R
setThread
(ThreadChannel channel) Set the target thread for the webhook message.default R
setThreadId
(long threadId) Set the target thread id for the webhook message.setThreadId
(String threadId) Set the target thread id for the webhook message.Methods inherited from interface net.dv8tion.jda.api.requests.FluentRestAction
addCheck, deadline, setCheck, timeout
Methods inherited from interface net.dv8tion.jda.api.requests.RestAction
and, and, complete, complete, completeAfter, delay, delay, delay, delay, flatMap, flatMap, getCheck, getJDA, map, mapToResult, onErrorFlatMap, onErrorFlatMap, onErrorMap, onErrorMap, onSuccess, queue, queue, queue, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, submit, submit, submitAfter, submitAfter, zip
-
Method Details
-
setThreadId
Set the target thread id for the webhook message.
This allows sending webhook messages in the target thread, however the webhook must be part of the thread parent channel.This cannot be used with
InteractionHooks
!- Parameters:
threadId
- The target thread id or null to unset- Returns:
- The same message action, for chaining convenience
- Throws:
IllegalStateException
- If this is an interaction webhookIllegalArgumentException
- If the provided ID is not a valid snowflake
-
setThreadId
Set the target thread id for the webhook message.
This allows sending webhook messages in the target thread, however the webhook must be part of the thread parent channel.This cannot be used with
InteractionHooks
!- Parameters:
threadId
- The target thread id or 0 to unset- Returns:
- The same message action, for chaining convenience
- Throws:
IllegalStateException
- If this is an interaction webhook
-
setThread
Set the target thread for the webhook message.
This allows sending webhook messages in the target thread, however the webhook must be part of the thread parent channel.This cannot be used with
InteractionHooks
!- Parameters:
channel
- The target thread channel- Returns:
- The same message action, for chaining convenience
- Throws:
IllegalStateException
- If this is an interaction webhook
-