Interface WebhookMessageCreateAction<T>

All Superinterfaces:
FluentRestAction<T,WebhookMessageCreateAction<T>>, MessageCreateRequest<WebhookMessageCreateAction<T>>, MessageData, MessageRequest<WebhookMessageCreateAction<T>>, RestAction<T>

public interface WebhookMessageCreateAction<T> extends MessageCreateRequest<WebhookMessageCreateAction<T>>, FluentRestAction<T,WebhookMessageCreateAction<T>>
Extension of a default RestAction that allows setting message information before sending!

This is available as return type of all sendMessage/sendFile methods in WebhookClient.

When this RestAction has been executed all provided files will be closed.
Note that the garbage collector also frees opened file streams when it finalizes the stream object.

See Also:
  • Method Details

    • setEphemeral

      @Nonnull @CheckReturnValue WebhookMessageCreateAction<T> setEphemeral(boolean ephemeral)
      Set whether this message should be visible to other users.
      When a message is ephemeral, it will only be visible to the user that used the interaction.

      Ephemeral messages have some limitations and will be removed once the user restarts their client.
      Limitations:

      • Cannot be reacted to
      • Cannot be retrieved

      This only works on InteractionHooks! For a deferred reply, this is not supported. When a reply is deferred, the very first message sent through the InteractionHook, inherits the ephemeral state of the initial reply. To send an ephemeral deferred reply, you must use deferReply(true) instead.

      Parameters:
      ephemeral - True, if this message should be invisible for other users
      Returns:
      The same message action, for chaining convenience