Interface AbstractWebhookMessageAction<T,R extends AbstractWebhookMessageAction<T,R>>

Type Parameters:
T - The result type
R - 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 thread id.
  • Method Details

    • setThreadId

      @Nonnull @CheckReturnValue R setThreadId(@Nullable String threadId)
      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 webhook
      IllegalArgumentException - If the provided ID is not a valid snowflake
    • setThreadId

      @Nonnull @CheckReturnValue default R setThreadId(long threadId)
      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

      @Nonnull @CheckReturnValue default R setThread(@Nullable ThreadChannel channel)
      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