Package org.javacord.api.entity
Interface Icon
-
public interface IconThis class represents a discord icon, for example a server icon or a user avatar.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.concurrent.CompletableFuture<java.awt.image.BufferedImage>asBufferedImage()Gets the icon asBufferedImage.java.util.concurrent.CompletableFuture<byte[]>asByteArray()Gets the icon as byte array.java.io.InputStreamasInputStream()Gets the input stream for the icon.java.net.URLgetUrl()Gets the url of the icon.default booleanisAnimated()Checks if the icon is animated.
-
-
-
Method Detail
-
getUrl
java.net.URL getUrl()
Gets the url of the icon.- Returns:
- The url of the icon.
-
isAnimated
default boolean isAnimated()
Checks if the icon is animated.- Returns:
- Whether the icon is animated or not.
-
asByteArray
java.util.concurrent.CompletableFuture<byte[]> asByteArray()
Gets the icon as byte array.- Returns:
- The icon as byte array.
-
asInputStream
java.io.InputStream asInputStream() throws java.io.IOExceptionGets the input stream for the icon. This can be used forMessageable.sendMessage(InputStream, String)- Returns:
- The input stream for the icon.
- Throws:
java.io.IOException- If an IO error occurs.
-
asBufferedImage
java.util.concurrent.CompletableFuture<java.awt.image.BufferedImage> asBufferedImage()
Gets the icon asBufferedImage.- Returns:
- The icon as BufferedImage.
-
-