Interface Emoji


public interface Emoji
Represents a chat emoji that can be inserted into messages.

An Emoji consists of:

  • A unique name
  • Optional aliases
  • A unicode character representation

Emojis can also generate a formatted Component description, typically used in menus, hover tooltips, or selection interfaces.

Instances are created using the builder(String, String) method.

  • Method Details

    • builder

      static Emoji.Builder<?> builder(@NotNull @NotNull String name, @NotNull @NotNull String unicodeCharacter)
      Creates a new Emoji.Builder for constructing an Emoji.
      Parameters:
      name - the unique name of the emoji
      unicodeCharacter - the unicode character representing the emoji
      Returns:
      a new emoji builder
    • name

      Returns the unique name of this emoji.
      Returns:
      the emoji name
    • aliases

      List<String> aliases()
      Returns all aliases associated with this emoji.

      Aliases can be used as alternative identifiers when parsing messages.

      Returns:
      a list of alias strings
    • unicodeCharacter

      @NotNull @NotNull String unicodeCharacter()
      Returns the unicode character representing this emoji.
      Returns:
      the unicode emoji character
    • asDescription

      @NotNull @NotNull Component asDescription(@NotNull @NotNull TextColor primaryColor, @NotNull @NotNull TextColor secondaryColor, boolean showClickToInsert)
      Creates a formatted description component for this emoji.

      The returned component is typically used in selection menus or hover tooltips and may optionally include a clickable hint.

      Parameters:
      primaryColor - the primary text color
      secondaryColor - the secondary text color
      showClickToInsert - whether to include a "click to insert" hint
      Returns:
      a formatted description component