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.

Since:
4.3.0
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 deleted by the bot
      • Cannot contain any files/attachments
      • Cannot be reacted to
      • Cannot be retrieved

      This only works on InteractionHooks!

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