Interface Message.Attachment

All Superinterfaces:
Entity, Snowflake, Timestamped
All Known Implementing Classes:
AttachmentImpl
Enclosing interface:
Message

public static interface Message.Attachment extends Snowflake
  • Method Details

    • fileName

      @Nonnull @CheckReturnValue String fileName()
      The name of the file represented by this attachment.
      Returns:
      String representing the file name. Never null.
    • size

      @Nonnegative @CheckReturnValue int size()
      The size of the file represented by this attachment, in bytes.
      Returns:
      Integer representing the file size. Never negative.
    • url

      @Nonnull @CheckReturnValue String url()
      The source URL for the file.
      Returns:
      String representing the source URL. Never null.
    • proxyUrl

      @Nonnull @CheckReturnValue String proxyUrl()
      The proxied URL for the file.
      Returns:
      String representing the proxied URL. Never null.
    • height

      @CheckReturnValue int height()
      The height of this attachment, if it's an image.
      Returns:
      Integer representing the height, or -1 if this attachment is not an image.
    • width

      @CheckReturnValue int width()
      The width of this attachment, if it's an image.
      Returns:
      Integer representing the width, or -1 if this attachment is not an image.
    • image

      @CheckReturnValue default boolean image()
      Whether this attachment is an image.
      Returns:
      True if this attachment is an image, false otherwise.
    • ephemeral

      boolean ephemeral()
      Indicates whether or not this attachment is ephemeral. Ephemeral attachments are automatically removed after a set period of time, the duration of which is unfortunately not documented. Ephemeral attachments are guaranteed to exist for at least as long as their containing message exists.
      Returns:
      Whether this attachment is ephemeral.