Constructor and Description |
---|
Attachment(java.lang.String id,
java.lang.String url,
java.lang.String proxyUrl,
java.lang.String fileName,
int size,
int height,
int width,
JDA jda) |
Modifier and Type | Method and Description |
---|---|
boolean |
download(java.io.File file)
Downloads this attachment to given File
|
java.lang.String |
getFileName()
The file name of the Attachment when it was first uploaded.
|
int |
getHeight()
The height of the Attachment if this Attachment is an image.
If this Attachment is not an image, this returns 0. |
java.lang.String |
getId()
The id of the attachment.
|
java.lang.String |
getProxyUrl()
The url of the Attachment, proxied by Discord.
|
int |
getSize()
The size of the attachment in bytes.
Example: if getSize() returns 1024, then the attachment is 1024 bytes, or 1KB, in size. |
java.lang.String |
getUrl()
The url of the Attachment, most likely on the Discord servers.
|
int |
getWidth()
The width of the Attachment if this Attachment is an image.
If this Attachment is not an image, this returns 0. |
boolean |
isImage()
Based on the values of getHeight and getWidth being larger than zero.
|
public Attachment(java.lang.String id, java.lang.String url, java.lang.String proxyUrl, java.lang.String fileName, int size, int height, int width, JDA jda)
public java.lang.String getId()
public java.lang.String getUrl()
public java.lang.String getProxyUrl()
public java.lang.String getFileName()
public boolean download(java.io.File file)
file
- The file, where the attachment will get downloaded topublic int getSize()
getSize()
returns 1024, then the attachment is 1024 bytes, or 1KB, in size.public int getHeight()
public int getWidth()
public boolean isImage()