Package org.javacord.api.entity.emoji
Interface CustomEmoji
-
- All Superinterfaces:
DiscordEntity,Emoji,java.util.Formattable,Mentionable,Nameable,Specializable<Emoji>,Updatable<KnownCustomEmoji>,UpdatableFromCache<KnownCustomEmoji>
- All Known Subinterfaces:
KnownCustomEmoji
public interface CustomEmoji extends DiscordEntity, Nameable, Emoji, UpdatableFromCache<KnownCustomEmoji>
This class represents a custom emoji. If it's an unknown custom emoji, the object won't be unique and won't receive any updates! OnlyKnownCustomEmojireceive updates!
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default java.util.Optional<CustomEmoji>asCustomEmoji()Gets the emoji as a custom emoji.default java.util.Optional<KnownCustomEmoji>asKnownCustomEmoji()Gets the emoji as a known custom emoji.default java.util.Optional<java.lang.String>asUnicodeEmoji()Gets the emoji as a unicode emoji.default java.util.Optional<KnownCustomEmoji>getCurrentCachedInstance()Gets an updated instance of this entity from the cache.IcongetImage()Gets the image of the emoji.default java.lang.StringgetMentionTag()Gets the tag used to mention the entity.default java.lang.StringgetReactionTag()Gets the tag used to add a reaction with the emoji.-
Methods inherited from interface org.javacord.api.entity.DiscordEntity
getApi, getCreationTimestamp, getId, getIdAsString
-
Methods inherited from interface org.javacord.api.entity.emoji.Emoji
equalsEmoji, equalsEmoji, isAnimated, isCustomEmoji, isKnownCustomEmoji, isUnicodeEmoji
-
Methods inherited from interface org.javacord.api.util.Specializable
as
-
Methods inherited from interface org.javacord.api.entity.UpdatableFromCache
getLatestInstance
-
-
-
-
Method Detail
-
getImage
Icon getImage()
Gets the image of the emoji.- Returns:
- The image of the emoji.
-
getReactionTag
default java.lang.String getReactionTag()
Gets the tag used to add a reaction with the emoji.- Returns:
- The tag used to add a reaction with the emoji.
-
getMentionTag
default java.lang.String getMentionTag()
Description copied from interface:MentionableGets the tag used to mention the entity.- Specified by:
getMentionTagin interfaceMentionable- Returns:
- The tag used to mention the entity.
-
asUnicodeEmoji
default java.util.Optional<java.lang.String> asUnicodeEmoji()
Description copied from interface:EmojiGets the emoji as a unicode emoji.- Specified by:
asUnicodeEmojiin interfaceEmoji- Returns:
- The emoji as a unicode emoji.
-
asCustomEmoji
default java.util.Optional<CustomEmoji> asCustomEmoji()
Description copied from interface:EmojiGets the emoji as a custom emoji.- Specified by:
asCustomEmojiin interfaceEmoji- Returns:
- The emoji as a custom emoji.
-
asKnownCustomEmoji
default java.util.Optional<KnownCustomEmoji> asKnownCustomEmoji()
Description copied from interface:EmojiGets the emoji as a known custom emoji.- Specified by:
asKnownCustomEmojiin interfaceEmoji- Returns:
- The emoji as a known custom emoji.
-
getCurrentCachedInstance
default java.util.Optional<KnownCustomEmoji> getCurrentCachedInstance()
Description copied from interface:UpdatableFromCacheGets an updated instance of this entity from the cache. This is for example necessary if an instance got invalid by a reconnect to Discord which invalidates all existing instances which means they do not get any further updates from Discord applied. Due to that, references to instances should usually not be held for an extended period of time. If they are, this method can be used to retrieve the current instance from the cache, that gets updates from Discord, in case this one was invalidated.This method returns the currently cached entity, or an empty
Optionalif the entity is not cached any longer, for example because it was deleted or the message was thrown out of the cache.- Specified by:
getCurrentCachedInstancein interfaceUpdatableFromCache<KnownCustomEmoji>- Returns:
- The current cached instance.
-
-