Interface Emoji

All Superinterfaces:
Entity, HasNullableName, Snowflake, Timestamped
All Known Subinterfaces:
Emoji.ActivityEmoji, Emoji.CustomEmoji, Emoji.UnicodeEmoji
All Known Implementing Classes:
ActivityEmojiImpl, CustomEmojiImpl, UnicodeEmojiImpl

public interface Emoji extends Snowflake, HasNullableName
Since:
9/5/18.
Author:
natanbc
  • Method Details

    • fromUnicode

      @Nonnull static Emoji.UnicodeEmoji fromUnicode(@Nonnull Catnip catnip, @Nonnull String unicode)
    • fromString

      @Nonnull static Emoji.CustomEmoji fromString(@Nonnull Catnip catnip, @Nonnull String name, @Nonnull String id, boolean animated)
    • id

      @Nonnull @CheckReturnValue String id()
      ID of this emoji, or null if it has no ID.
      Always null for unicode emoji.
      Specified by:
      id in interface Snowflake
      Returns:
      String representing the ID.
    • name

      @Nullable @CheckReturnValue String name()
      Name of this emoji, if it's custom, or it's unicode value.
      This may be null in the case of reactions.
      Specified by:
      name in interface HasNullableName
      Returns:
      String representing the name or unicode value.
    • roles

      @Nonnull @CheckReturnValue List<String> roles()
      Roles that are allowed to use this emoji. If empty, all users can use it.
      Always empty for unicode emoji.
      Returns:
      List of role IDs allowed.
    • user

      @Nullable @CheckReturnValue User user()
      User who uploaded this emoji.
      Always null for unicode emoji.
      Returns:
      User who uploaded the emoji.
    • requiresColons

      @CheckReturnValue boolean requiresColons()
      Whether this emoji must be wrapped in colons.
      Returns:
      True if it should be wrapped in colons, false otherwise.
    • managed

      @CheckReturnValue boolean managed()
      Whether this emoji is managed.
      Always false for unicode emoji.
      Returns:
      True if it's managed, false otherwise.
    • animated

      @CheckReturnValue boolean animated()
      Whether this emoji is animated.
      Always false for unicode emoji.
      Returns:
      True if it's animated, false otherwise.
    • custom

      @CheckReturnValue boolean custom()
      Whether this emoji is custom.
      Returns:
      True if this emoji is custom, false otherwise.
    • unicode

      @CheckReturnValue default boolean unicode()
      Whether this emoji is unicode.
      This method is equivalent to !custom().
      Returns:
      True if this emoji is custom, false otherwise.
    • forMessage

      @Nonnull @CheckReturnValue String forMessage()
      A string that may be sent in a message and will render this emoji, if the user has permission to.
      Returns:
      A string that yields this emoji when inside a message.
    • forReaction

      @Nonnull @CheckReturnValue String forReaction()
      A string that may be added as a reaction to a message, if the user has permission to.
      Returns:
      A string that yields this emoji when added as a reaction.
    • is

      @CheckReturnValue boolean is(@Nonnull String emoji)
      Checks whether or not this emoji is the provided emoji string.
      If this emoji is unicode, it's name is compared for equality with the provided string.
      If this emoji is custom, the following checks, in order, are applied:
      Parameters:
      emoji - Emoji string to compare against.
      Returns:
      True, if this emoji is equal to the provided string.