Package ovh.mythmc.social.api.emoji
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.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceEmoji.Builder<T extends Emoji.Builder<T>>A builder for constructingEmojiinstances. -
Method Summary
Modifier and TypeMethodDescriptionaliases()Returns all aliases associated with this emoji.asDescription(@NotNull TextColor primaryColor, @NotNull TextColor secondaryColor, boolean showClickToInsert) Creates a formatted description component for this emoji.static Emoji.Builder<?> Creates a newEmoji.Builderfor constructing anEmoji.name()Returns the unique name of this emoji.Returns the unicode character representing this emoji.
-
Method Details
-
builder
static Emoji.Builder<?> builder(@NotNull @NotNull String name, @NotNull @NotNull String unicodeCharacter) Creates a newEmoji.Builderfor constructing anEmoji.- Parameters:
name- the unique name of the emojiunicodeCharacter- the unicode character representing the emoji- Returns:
- a new emoji builder
-
name
Returns the unique name of this emoji.- Returns:
- the emoji name
-
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
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 colorsecondaryColor- the secondary text colorshowClickToInsert- whether to include a "click to insert" hint- Returns:
- a formatted description component
-