Package net.dv8tion.jda.api.components
Interface ResolvedMedia
- All Known Implementing Classes:
ResolvedMediaImpl
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 returnnull
if this media was created from an external link.default Long
The ID of the attachment represented by this resolved media, may returnnull
if this media was created from an external link.The media type, if available, ornull
.int
The height of this media, if available, or0
.getProxy()
AnAttachmentProxy
for 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.int
getWidth()
The width of this media, if available, or0
.
-
Method Details
-
getAttachmentId
The ID of the attachment represented by this resolved media, may returnnull
if 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 returnnull
if 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
AnAttachmentProxy
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, or0
.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, or0
.This may be
0
if the media failed to load.- Returns:
- Height of this media, or
0
-
getContentType
- Returns:
- The media type, or
null
-