Package net.dv8tion.jda.api.components
Interface ResolvedMedia
public interface ResolvedMedia
A media resolved by Discord including some metadata,
typically comes from V2 Components.
-
Method Summary
Modifier and TypeMethodDescriptionThe ID of the attachment represented by this resolved media, may returnnullif this media was created from an external link.default LongThe ID of the attachment represented by this resolved media, may returnnullif this media was created from an external link.The media type, if available, ornull.intThe height of this media, if available, or0.getProxy()AnAttachmentProxyfor this media.The URL of this media, proxied by Discord's CDN.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.intgetWidth()The width of this media, if available, or0.
-
Method Details
-
getAttachmentId
The ID of the attachment represented by this resolved media, may returnnullif this media was created from an external link.- Returns:
- The ID of the attachment, or
null
-
getAttachmentIdLong
The ID of the attachment represented by this resolved media, may returnnullif this media was created from an external link.- Returns:
- The ID of the attachment, or
null
-
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
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
AnAttachmentProxyfor this media.
This allows you to easily download the media.This proxy may not be usable if the media failed to load.
- Returns:
- The
AttachmentProxyof this media
-
getWidth
int getWidth()The width of this media, if available, or0.This may be
0if the media failed to load.- Returns:
- Width of this media, or
0
-
getHeight
int getHeight()The height of this media, if available, or0.This may be
0if the media failed to load.- Returns:
- Height of this media, or
0
-
getContentType
- Returns:
- The media type, or
null
-