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
Modifier and TypeInterfaceDescriptionstatic enum
The various formats used for stickers and the respective file extensions.static enum
The specific types of stickers -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic StickerSnowflake
fromId
(long id) Creates a sticker snowflake instance which only wraps an ID.static StickerSnowflake
Creates a sticker snowflake instance which only wraps an ID.The format type of this sticker, used forgetIconUrl()
.default ImageProxy
getIcon()
Returns anImageProxy
for this sticker's image.default String
The 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.StickerFormat
of this sticker
-
getName
The name of the sticker.- Returns:
- the name of the sticker
-
getIconUrl
The url of the sticker image.
Note thatLOTTIE
stickers don't provide an image, but a JSON format.- Returns:
- The image url of the sticker
- Throws:
IllegalStateException
- If theStickerFormat
of this sticker isUNKNOWN
-
getIcon
Returns anImageProxy
for this sticker's image.The size parameter for
ImageProxy
is not supported for stickers of typeLOTTIE
.- Returns:
- Never-null
ImageProxy
of this sticker's image - Throws:
IllegalStateException
- If theSticker.StickerFormat
of this sticker isUNKNOWN
- See Also:
-