Class MessageReaction.ReactionEmote

  • All Implemented Interfaces:
    ISnowflake
    Enclosing class:
    MessageReaction

    public static class MessageReaction.ReactionEmote
    extends java.lang.Object
    implements ISnowflake
    Represents an Emoji/Emote of a MessageReaction
    This is used to wrap both emojis and emotes
    • Method Detail

      • isEmote

        public boolean isEmote()
        Whether this is an Emote wrapper.
        This means getEmoji() will throw IllegalStateException.
        Returns:
        True, if getEmote() can be used
        See Also:
        getEmote()
      • getName

        @Nonnull
        public java.lang.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.

        Custom emotes may return an empty string for this if the emote was deleted.

        Returns:
        The name for this emote/emoji
      • getAsCodepoints

        @Nonnull
        public java.lang.String getAsCodepoints()
        Converts the unicode name into codepoint notation like U+1F602.
        Returns:
        String containing the codepoint representation of the reaction emoji
        Throws:
        java.lang.IllegalStateException - If this is not an emoji reaction, see isEmoji()
      • 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 interface ISnowflake
        Returns:
        Long containing the Id.
      • getAsReactionCode

        @Nonnull
        public java.lang.String 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

        @Nonnull
        public java.lang.String getEmoji()
        The unicode representing the emoji used for reacting.
        Returns:
        The unicode for the emoji
        Throws:
        java.lang.IllegalStateException - If this is not an emoji reaction, see isEmoji()
      • getEmote

        @Nonnull
        public Emote getEmote()
        The instance of Emote for the Reaction instance.
        Returns:
        The Emote for the Reaction instance
        Throws:
        java.lang.IllegalStateException - If this is not a custom emote reaction, see isEmote()
      • getJDA

        @Nonnull
        public JDA getJDA()
        The current JDA instance for the Reaction
        Returns:
        The JDA instance of the Reaction
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object