Package net.dv8tion.jda.api.entities
Class MessageReaction.ReactionEmote
java.lang.Object
net.dv8tion.jda.api.entities.MessageReaction.ReactionEmote
- All Implemented Interfaces:
ISnowflake
- Enclosing class:
- MessageReaction
Represents an Emoji/Emote of a MessageReaction
This is used to wrap both emojis and emotes
This is used to wrap both emojis and emotes
-
Method Summary
Modifier and TypeMethodDescriptionboolean
fromCustom
(Emote emote) fromUnicode
(String name, JDA api) Converts the unicode name into codepoint notation likeU+1F602
.The code for this Reaction.getEmoji()
The unicode representing the emoji used for reacting.getEmote()
The instance ofEmote
for the Reaction instance.long
The Snowflake id of this entity.getJDA()
The current JDA instance for the ReactiongetName()
The name for this emote/emoji
For unicode emojis this will be the unicode of said emoji rather than an alias like:smiley:
.boolean
isEmoji()
Whether this represents a unicode emoji.boolean
isEmote()
Whether this is anEmote
wrapper.toString()
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getTimeCreated
-
Method Details
-
fromUnicode
-
fromCustom
-
isEmote
public boolean isEmote()- Returns:
- True, if
getEmote()
can be used - See Also:
-
isEmoji
public boolean isEmoji()Whether this represents a unicode emoji.
This meansgetEmote()
,ISnowflake.getId()
, andgetIdLong()
will not be available.- Returns:
- True, if this represents a unicode emoji
- See Also:
-
getName
The name for this emote/emoji
For unicode emojis this will be the unicode of said emoji rather than an alias like:smiley:
.For better use in consoles that do not support unicode emoji use
getAsCodepoints()
for a more readable representation of the emoji.Custom emotes may return an empty string for this if the emote was deleted.
- Returns:
- The name for this emote/emoji
-
getAsCodepoints
Converts the unicode name into codepoint notation likeU+1F602
.- Returns:
- String containing the codepoint representation of the reaction emoji
- Throws:
IllegalStateException
- If this is not an emoji reaction, seeisEmoji()
-
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.
-
getAsReactionCode
The code for this Reaction.
For unicode emojis this will be the unicode of said emoji rather than an alias like:smiley:
.
For custom emotes this will be the name and id of said emote in the format<name>:<id>
.- Returns:
- The unicode if it is an emoji, or the name and id in the format
<name>:<id>
-
getEmoji
The unicode representing the emoji used for reacting.- Returns:
- The unicode for the emoji
- Throws:
IllegalStateException
- If this is not an emoji reaction, seeisEmoji()
-
getEmote
The instance ofEmote
for the Reaction instance.- Returns:
- The Emote for the Reaction instance
- Throws:
IllegalStateException
- If this is not a custom emote reaction, seeisEmote()
-
getJDA
The current JDA instance for the Reaction- Returns:
- The JDA instance of the Reaction
-
equals
-
toString
-