Class ReadonlyAttachment
- java.lang.Object
-
- club.minnced.discord.webhook.receive.ReadonlyAttachment
-
- All Implemented Interfaces:
org.json.JSONString
public class ReadonlyAttachment extends Object implements org.json.JSONString
Readonly message attachment meta-data.
This does not actually contain the file but only meta-data useful to retrieve the actual attachment.
-
-
Constructor Summary
Constructors Constructor Description ReadonlyAttachment(@NotNull String url, @NotNull String proxyUrl, @NotNull String fileName, int width, int height, int size, long id)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull String
getFileName()
The name of this attachmentint
getHeight()
Height of the attachment, this is only relevant to images and videoslong
getId()
The id of this attachment@NotNull String
getProxyUrl()
The proxy url for this attachment, this is used by the client to generate previews of images.int
getSize()
The approximated size of this embed in bytes@NotNull String
getUrl()
The URL for this attachmentint
getWidth()
Width of the attachment, this is only relevant to images and videosString
toJSONString()
String
toString()
JSON representation of this attachment
-
-
-
Method Detail
-
getUrl
@NotNull public @NotNull String getUrl()
The URL for this attachment- Returns:
- The url
-
getProxyUrl
@NotNull @JSONPropertyName("proxy_url") public @NotNull String getProxyUrl()
The proxy url for this attachment, this is used by the client to generate previews of images.- Returns:
- The proxy url
-
getFileName
@NotNull @JSONPropertyName("filename") public @NotNull String getFileName()
The name of this attachment- Returns:
- The file name
-
getSize
public int getSize()
The approximated size of this embed in bytes- Returns:
- The approximated size in bytes
-
getWidth
public int getWidth()
Width of the attachment, this is only relevant to images and videos- Returns:
- Width of this image, or -1 if not an image or video
-
getHeight
public int getHeight()
Height of the attachment, this is only relevant to images and videos- Returns:
- Height of this image, or -1 if not an image or video
-
getId
public long getId()
The id of this attachment- Returns:
- The idi
-
toString
public String toString()
JSON representation of this attachment
-
toJSONString
public String toJSONString()
- Specified by:
toJSONString
in interfaceorg.json.JSONString
-
-