Package com.mewna.catnip.entity.misc
Interface Emoji
- All Superinterfaces:
Entity
,HasNullableName
,Snowflake
,Timestamped
- All Known Subinterfaces:
Emoji.ActivityEmoji
,Emoji.CustomEmoji
,Emoji.UnicodeEmoji
- All Known Implementing Classes:
ActivityEmojiImpl
,CustomEmojiImpl
,UnicodeEmojiImpl
- Since:
- 9/5/18.
- Author:
- natanbc
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
The emoji in a user's activity, ex.static interface
static interface
Nested classes/interfaces inherited from interface com.mewna.catnip.entity.partials.Timestamped
Timestamped.TimestampStyle
-
Method Summary
Modifier and TypeMethodDescriptionboolean
animated()
Whether this emoji is animated.boolean
custom()
Whether this emoji iscustom
.A string that may be sent in a message and will render this emoji, if the user has permission to.A string that may be added as a reaction to a message, if the user has permission to.static Emoji.CustomEmoji
fromString
(Catnip catnip, String name, String id, boolean animated) static Emoji.UnicodeEmoji
fromUnicode
(Catnip catnip, String unicode) id()
ID of this emoji, or null if it has no ID.boolean
Checks whether or not this emoji is the provided emoji string.boolean
managed()
Whether this emoji is managed.name()
boolean
Whether this emoji must be wrapped in colons.roles()
Roles that are allowed to use this emoji.default boolean
unicode()
Whether this emoji isunicode
.user()
User who uploaded this emoji.Methods inherited from interface com.mewna.catnip.entity.partials.Snowflake
creationTime, creationTimestamp, idAsLong
Methods inherited from interface com.mewna.catnip.entity.partials.Timestamped
asDiscordTimestamp, parseTimestamp
-
Method Details
-
fromUnicode
-
fromString
@Nonnull static Emoji.CustomEmoji fromString(@Nonnull Catnip catnip, @Nonnull String name, @Nonnull String id, boolean animated) -
id
ID of this emoji, or null if it has no ID.
Always null forunicode
emoji. -
name
Name of this emoji, if it'scustom
, or it'sunicode
value.
This may be null in the case of reactions.- Specified by:
name
in interfaceHasNullableName
- Returns:
- String representing the name or unicode value.
-
roles
Roles that are allowed to use this emoji. If empty, all users can use it.
Always empty forunicode
emoji.- Returns:
- List of role IDs allowed.
-
user
User who uploaded this emoji.
Always null forunicode
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 forunicode
emoji.- Returns:
- True if it's managed, false otherwise.
-
animated
@CheckReturnValue boolean animated()Whether this emoji is animated.
Always false forunicode
emoji.- Returns:
- True if it's animated, false otherwise.
-
custom
@CheckReturnValue boolean custom()Whether this emoji iscustom
.- Returns:
- True if this emoji is custom, false otherwise.
-
unicode
@CheckReturnValue default boolean unicode()- Returns:
- True if this emoji is custom, false otherwise.
-
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
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
Checks whether or not this emoji is the provided emoji string.
If this emoji isunicode
, it'sname
is compared for equality with the provided string.
If this emoji iscustom
, the following checks, in order, are applied:id
equalityforMessage()
equalityforReaction()
forReaction()} equality
- Parameters:
emoji
- Emoji string to compare against.- Returns:
- True, if this emoji is equal to the provided string.
-