Interface Sticker
- All Superinterfaces:
ISnowflake,StickerSnowflake
- All Known Subinterfaces:
GuildSticker,RichSticker,StandardSticker,StickerItem,StickerUnion
Abstract representation of all sticker types.
This is specialized in StandardSticker and GuildSticker.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumThe various formats used for stickers and the respective file extensions.static enumThe specific types of stickers -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic StickerSnowflakefromId(long id) Creates a sticker snowflake instance which only wraps an ID.static StickerSnowflakeCreates a sticker snowflake instance which only wraps an ID.The format type of this sticker, used forgetIconUrl().default ImageProxygetIcon()Returns anImageProxyfor this sticker's image.default StringThe url of the sticker image.getName()The name of the sticker.Methods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getIdLong, getTimeCreated
-
Field Details
-
ICON_URL
Template forgetIconUrl()- See Also:
-
-
Method Details
-
fromId
Creates a sticker snowflake instance which only wraps an ID.This is primarily used for message sending purposes.
- Parameters:
id- The sticker id- Returns:
- A sticker snowflake instance
- See Also:
-
fromId
Creates a sticker snowflake instance which only wraps an ID.This is primarily used for message sending purposes.
- Parameters:
id- The sticker id- Returns:
- A sticker snowflake instance
- Throws:
IllegalArgumentException- If the provided ID is not a valid snowflake- See Also:
-
getFormatType
The format type of this sticker, used forgetIconUrl().
Note that stickers can be of typeLOTTIE, which don't have simple image icons, but instead rely on client-side rendering.Future stickers might have format
UNKNOWN, which cannot be converted to a URL.- Returns:
- The
Sticker.StickerFormatof this sticker
-
getName
The name of the sticker.- Returns:
- the name of the sticker
-
getIconUrl
The url of the sticker image.
Note thatLOTTIEstickers don't provide an image, but a JSON format.- Returns:
- The image url of the sticker
- Throws:
IllegalStateException- If theStickerFormatof this sticker isUNKNOWN
-
getIcon
Returns anImageProxyfor this sticker's image.The size parameter for
ImageProxyis not supported for stickers of typeLOTTIE.- Returns:
- Never-null
ImageProxyof this sticker's image - Throws:
IllegalStateException- If theSticker.StickerFormatof this sticker isUNKNOWN- See Also:
-