public abstract class ReactionEmoji extends Object
message reactions
, provides factory methods such as unicode(String)
and others to generate reactions.Modifier and Type | Class and Description |
---|---|
static class |
ReactionEmoji.Custom |
static class |
ReactionEmoji.Unicode |
Constructor and Description |
---|
ReactionEmoji() |
Modifier and Type | Method and Description |
---|---|
Optional<ReactionEmoji.Custom> |
asCustomEmoji()
Gets this emoji as downcasted to
a custom reaction emoji . |
Optional<ReactionEmoji.Unicode> |
asUnicodeEmoji()
Gets this emoji downcasted to
a unicode reaction emoji . |
static ReactionEmoji.Custom |
custom(GuildEmoji emoji)
Constructs a
ReactionEmoji using information from a known guild emoji . |
static ReactionEmoji.Custom |
custom(Snowflake id,
String name,
boolean isAnimated)
Constructs a
ReactionEmoji for a custom emoji using the given information. |
static ReactionEmoji |
of(Long id,
String name,
boolean isAnimated)
Constructs a
ReactionEmoji for generic emoji information. |
static ReactionEmoji.Unicode |
unicode(String raw)
Constructs a
ReactionEmoji for a unicode emoji. |
public static ReactionEmoji.Custom custom(GuildEmoji emoji)
ReactionEmoji
using information from a known guild emoji
.emoji
- The guild emoji from which to take information.public static ReactionEmoji.Custom custom(Snowflake id, String name, boolean isAnimated)
ReactionEmoji
for a custom emoji using the given information.id
- The ID of the custom emoji.name
- The name of the custom emoji.isAnimated
- Whether the custom emoji is animated.public static ReactionEmoji.Unicode unicode(String raw)
ReactionEmoji
for a unicode emoji.raw
- The raw unicode string for the emoji.public static ReactionEmoji of(@Nullable Long id, String name, boolean isAnimated)
ReactionEmoji
for generic emoji information.id
- The ID of the custom emoji OR null if the emoji is a unicode emoji.name
- The name of the custom emoji OR the raw unicode string for the emoji.isAnimated
- Whether the emoji is animated OR false if the emoji is a unicode emoji.public Optional<ReactionEmoji.Custom> asCustomEmoji()
a custom reaction emoji
.public Optional<ReactionEmoji.Unicode> asUnicodeEmoji()
a unicode reaction emoji
.