Package net.dv8tion.jda.api.entities
Class MessageSticker
- java.lang.Object
-
- net.dv8tion.jda.api.entities.MessageSticker
-
- All Implemented Interfaces:
ISnowflake
public class MessageSticker extends java.lang.Object implements ISnowflake
An object representing a sticker in a Discord message.- See Also:
Message.getStickers()
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MessageSticker.StickerFormat
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ASSET_URL
Deprecated.UseICON_URL
insteadstatic java.lang.String
ICON_URL
Template forgetIconUrl()
-
Constructor Summary
Constructors Constructor Description MessageSticker(long id, java.lang.String name, java.lang.String description, long packId, java.lang.String asset, MessageSticker.StickerFormat formatType, java.util.Set<java.lang.String> tags)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.String
getAssetHash()
Deprecated.UsegetIconUrl()
insteadjava.lang.String
getAssetUrl()
Deprecated.UsegetIconUrl()
insteadjava.lang.String
getDescription()
The description of the sticker or empty String if the sticker doesn't have one.MessageSticker.StickerFormat
getFormatType()
TheFormat
of the sticker.java.lang.String
getIconUrl()
The url of the sticker image.long
getIdLong()
The Snowflake id of this entity.java.lang.String
getName()
The name of the sticker.java.lang.String
getPackId()
The ID of the pack the sticker is from.long
getPackIdLong()
The ID of the pack the sticker is from.java.util.Set<java.lang.String>
getTags()
Set of tags of the sticker.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getTimeCreated
-
-
-
-
Field Detail
-
ASSET_URL
@Deprecated @ForRemoval(deadline="5.0.0") @ReplaceWith("ICON_URL") @DeprecatedSince("4.3.1") public static final java.lang.String ASSET_URL
Deprecated.UseICON_URL
insteadTemplate forgetAssetUrl()
- See Also:
- Constant Field Values
-
ICON_URL
public static final java.lang.String ICON_URL
Template forgetIconUrl()
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MessageSticker
public MessageSticker(long id, java.lang.String name, java.lang.String description, long packId, java.lang.String asset, MessageSticker.StickerFormat formatType, java.util.Set<java.lang.String> tags)
-
-
Method Detail
-
getIdLong
public long getIdLong()
Description copied from interface:ISnowflake
The Snowflake id of this entity. This is unique to every entity and will never change.- Specified by:
getIdLong
in interfaceISnowflake
- Returns:
- Long containing the Id.
-
getName
@Nonnull public java.lang.String getName()
The name of the sticker.- Returns:
- the name of the sticker
-
getDescription
@Nonnull public java.lang.String getDescription()
The description of the sticker or empty String if the sticker doesn't have one.- Returns:
- Possibly-empty String containing the description of the sticker
-
getPackId
@Nonnull public java.lang.String getPackId()
The ID of the pack the sticker is from.If this sticker is from a guild, this will be the guild id instead.
- Returns:
- the ID of the pack the sticker is from
-
getPackIdLong
public long getPackIdLong()
The ID of the pack the sticker is from.If this sticker is from a guild, this will be the guild id instead.
- Returns:
- the ID of the pack the sticker is from
-
getAssetHash
@Nonnull @Deprecated @ForRemoval(deadline="5.0.0") @ReplaceWith("getIconUrl()") @DeprecatedSince("4.3.1") public java.lang.String getAssetHash()
Deprecated.UsegetIconUrl()
insteadThe Discord hash-id of the sticker. This represents the actual asset file in the CDN for the sticker.
The URL for fetching sticker assets is currently private.- Returns:
- the Discord hash-id of the sticker
-
getAssetUrl
@Nonnull @Deprecated @ForRemoval(deadline="5.0.0") @ReplaceWith("getIconUrl()") @DeprecatedSince("4.3.1") public java.lang.String getAssetUrl()
Deprecated.UsegetIconUrl()
insteadThe url of the sticker asset.- Returns:
- the url of the sticker
- Throws:
java.lang.IllegalStateException
- If theStickerFormat
of this sticker isUNKNOWN
-
getIconUrl
@Nonnull public java.lang.String getIconUrl()
The url of the sticker image.- Returns:
- The image url of the sticker
- Throws:
java.lang.IllegalStateException
- If theStickerFormat
of this sticker isUNKNOWN
-
getFormatType
@Nonnull public MessageSticker.StickerFormat getFormatType()
TheFormat
of the sticker.- Returns:
- the format of the sticker
-
getTags
@Nonnull public java.util.Set<java.lang.String> getTags()
Set of tags of the sticker. Tags can be used instead of the name of the sticker as aliases.- Returns:
- Possibly-empty unmodifiable Set of tags of the sticker
-
-