Interface ResolvedMedia


public interface ResolvedMedia
A media resolved by Discord including some metadata, typically comes from V2 Components.
  • Method Details

    • getAttachmentId

      @Nullable String getAttachmentId()
      The ID of the attachment represented by this resolved media, may return null if this media was created from an external link.
      Returns:
      The ID of the attachment, or null
    • getAttachmentIdLong

      @Nullable default Long getAttachmentIdLong()
      The ID of the attachment represented by this resolved media, may return null if this media was created from an external link.
      Returns:
      The ID of the attachment, or null
    • getUrl

      @Nonnull String getUrl()
      The URL of this media, for locally-uploaded files, this will always be a URL from Discord's CDN, in other cases it may be an external URL.

      If you want to download the file, you should use getProxy().

      Returns:
      The URL of this media
    • getProxyUrl

      @Nonnull String getProxyUrl()
      The URL of this media, proxied by Discord's CDN.

      This URL may be invalid if the media failed to load.

      If you want to download the file, you should use getProxy().

      Returns:
      The proxy URL of this media
    • getProxy

      @Nonnull AttachmentProxy getProxy()
      An AttachmentProxy for this media.
      This allows you to easily download the media.

      This proxy may not be usable if the media failed to load.

      Returns:
      The AttachmentProxy of this media
    • getWidth

      int getWidth()
      The width of this media, if available, or 0.

      This may be 0 if the media failed to load.

      Returns:
      Width of this media, or 0
    • getHeight

      int getHeight()
      The height of this media, if available, or 0.

      This may be 0 if the media failed to load.

      Returns:
      Height of this media, or 0
    • getContentType

      @Nullable String getContentType()
      The media type, if available, or null.

      This may be absent if the media failed to load.

      Returns:
      The media type, or null
    • getPlaceholder

      @Nullable ThumbHashPlaceholder getPlaceholder()
      The placeholder, if this is an image or video, or null.
      Returns:
      The placeholder or null
      See Also:
    • getFlagsRaw

      long getFlagsRaw()
      Returns the raw media flags of this media.
      Returns:
      The raw media flags
      See Also:
    • getFlags

      @Nonnull @Unmodifiable Set<ResolvedMedia.ResolvedMediaFlag> getFlags()
      Returns an unmodifiable set of all ResolvedMediaFlags present for this media.
      Returns:
      Unmodifiable set of present ResolvedMediaFlags
      See Also: