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
public static class MessageReaction.ReactionEmote extends Object implements ISnowflake
Represents an Emoji/Emote of a MessageReaction
This is used to wrap both emojis and emotes
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)static MessageReaction.ReactionEmotefromCustom(Emote emote)static MessageReaction.ReactionEmotefromUnicode(String name, JDA api)StringgetAsCodepoints()Converts the unicode name into codepoint notation likeU+1F602.StringgetEmoji()The unicode representing the emoji used for reacting.EmotegetEmote()The instance ofEmotefor the Reaction instance.longgetIdLong()The Snowflake id of this entity.JDAgetJDA()The current JDA instance for the ReactionStringgetName()The name for this emote/emoji
For unicode emojis this will be the unicode of said emoji rather than an alias like:smiley:.booleanisEmoji()Whether this represents a unicode emoji.booleanisEmote()Whether this is anEmotewrapper.StringtoString()-
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 Detail
-
fromUnicode
@Nonnull public static MessageReaction.ReactionEmote fromUnicode(@Nonnull String name, @Nonnull JDA api)
-
fromCustom
@Nonnull public static MessageReaction.ReactionEmote fromCustom(@Nonnull Emote emote)
-
isEmote
public boolean isEmote()
- Returns:
- True, if
getEmote()can be used - See Also:
getEmote()
-
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:
getEmoji()
-
getName
@Nonnull public String 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.- Returns:
- The name for this emote/emoji
-
getAsCodepoints
@Nonnull public String 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:ISnowflakeThe Snowflake id of this entity. This is unique to every entity and will never change.- Specified by:
getIdLongin interfaceISnowflake- Returns:
- Long containing the Id.
-
getEmoji
@Nonnull public String 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
@Nonnull public Emote getEmote()
The instance ofEmotefor the Reaction instance.- Returns:
- The Emote for the Reaction instance
- Throws:
IllegalStateException- If this is not a custom emote reaction, seeisEmote()
-
getJDA
@Nonnull public JDA getJDA()
The current JDA instance for the Reaction- Returns:
- The JDA instance of the Reaction
-
-