Class RichCustomEmojiImpl
java.lang.Object
net.dv8tion.jda.internal.entities.emoji.RichCustomEmojiImpl
- All Implemented Interfaces:
Formattable
,CustomEmoji
,Emoji
,EmojiUnion
,RichCustomEmoji
,IMentionable
,ISnowflake
,SerializableData
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.dv8tion.jda.api.entities.emoji.Emoji
Emoji.Type
-
Field Summary
Fields inherited from interface net.dv8tion.jda.api.entities.emoji.CustomEmoji
EMOJI_NAME_MAX_LENGTH, ICON_URL
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the underlyingApplicationEmoji
if applicable.asCustom()
Returns the underlyingCustomEmoji
if applicable.asRich()
Returns the underlyingRichCustomEmoji
if applicable.Returns the underlyingUnicodeEmoji
if applicable.copy()
delete()
Deletes this emoji.boolean
The reaction code for this emoji.getGuild()
TheGuild
this emoji is attached to.long
The Snowflake id of this entity.getJDA()
TheJDA
instance of this emojiTheManager
for this emoji, used to modify properties of the emoji like name and role restrictions.getName()
The name of this emoji.getOwner()
The user who created this emojigetRoles()
Roles this emoji is active for.getType()
TheEmoji.Type
of this emoji.int
hashCode()
boolean
Whether this emoji is animated.boolean
Whether this emoji is available.boolean
Whether this emoji is managed.Retrieves the owner of this emoji.setAnimated
(boolean animated) setAvailable
(boolean available) setManaged
(boolean val) toData()
SerializedDataObject
for this object.toString()
Methods inherited from interface net.dv8tion.jda.api.entities.emoji.CustomEmoji
formatTo, getAsMention, getFormatted, getImage, getImageUrl
Methods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getTimeCreated
Methods inherited from interface net.dv8tion.jda.api.entities.emoji.RichCustomEmoji
canInteract, canInteract, canInteract
-
Constructor Details
-
RichCustomEmojiImpl
-
-
Method Details
-
getType
Description copied from interface:Emoji
TheEmoji.Type
of this emoji.- Specified by:
getType
in interfaceCustomEmoji
- Specified by:
getType
in interfaceEmoji
- Returns:
- The
Emoji.Type
-
getAsReactionCode
Description copied from interface:Emoji
The reaction code for this emoji.
For unicode emojis this will be the unicode of said emoji rather than an alias like:smiley:
.
For custom emojis this will be the name and id of said emoji in the format<name>:<id>
.- Specified by:
getAsReactionCode
in interfaceEmoji
- Returns:
- The unicode if it is an emoji, or the name and id in the format
<name>:<id>
-
toData
Description copied from interface:SerializableData
SerializedDataObject
for this object.- Specified by:
toData
in interfaceSerializableData
- Returns:
DataObject
-
getGuild
Description copied from interface:RichCustomEmoji
TheGuild
this emoji is attached to.- Specified by:
getGuild
in interfaceRichCustomEmoji
- Returns:
- Guild of this emoji
-
getRoles
Description copied from interface:RichCustomEmoji
Roles this emoji is active for.
Learn More- Specified by:
getRoles
in interfaceRichCustomEmoji
- Returns:
- An immutable list of the roles this emoji is active for (all roles if empty)
-
getName
Description copied from interface:Emoji
The name of this emoji.
This will be the unicode characters if this emoji is not ofEmoji.getType()
CUSTOM
. -
isManaged
public boolean isManaged()Description copied from interface:RichCustomEmoji
Whether this emoji is managed. A managed emoji is controlled by Discord, not the Guild administrator, typical via a service like BTTV in conjunction with Twitch.
Learn More- Specified by:
isManaged
in interfaceRichCustomEmoji
- Returns:
- True, if this emoji is managed
-
isAvailable
public boolean isAvailable()Description copied from interface:RichCustomEmoji
Whether this emoji is available. When an emoji becomes unavailable, it cannot be used in messages. An emoji becomes unavailable when theBoostTier
of the guild drops such that the maximum allowed emojis is lower than the total amount of emojis added to the guild.If an emoji is added to the guild when the boost tier allows for more than 50 normal and 50 animated emojis (BoostTier is at least
TIER_1
) and the emoji is at least the 51st one added, then the emoji becomes unavailable when the BoostTier drops below a level that allows those emojis to be used.
emojis that where added as part of a lower BoostTier (i.e. the 51st emoji on BoostTier 2) will remain available, as long as the BoostTier stays above the required level.- Specified by:
isAvailable
in interfaceRichCustomEmoji
- Returns:
- True, if this emoji is available
-
getIdLong
public long getIdLong()Description copied from interface:ISnowflake
The Snowflake id of this entity. This is unique to every entity and will never change.- Specified by:
getIdLong
in interfaceISnowflake
- Returns:
- Long containing the Id.
-
getJDA
Description copied from interface:RichCustomEmoji
TheJDA
instance of this emoji- Specified by:
getJDA
in interfaceRichCustomEmoji
- Returns:
- The JDA instance of this emoji
-
getOwner
Description copied from interface:RichCustomEmoji
The user who created this emojiThis is only available for manually retrieved emojis from
Guild.retrieveEmojis()
andGuild.retrieveEmojiById(long)
.
RequiresPermission.MANAGE_GUILD_EXPRESSIONS
.- Specified by:
getOwner
in interfaceRichCustomEmoji
- Returns:
- The user who created this emoji, or null if not provided
- See Also:
-
retrieveOwner
Description copied from interface:RichCustomEmoji
Retrieves the owner of this emoji.
IfRichCustomEmoji.getOwner()
is present, this will directly return the owner in a completedRestAction
without making a request. The user information might be outdated, you can useaction.useCache(false)
to force an update.- Specified by:
retrieveOwner
in interfaceRichCustomEmoji
- Returns:
RestAction
- Type:User
- See Also:
-
getManager
Description copied from interface:RichCustomEmoji
TheManager
for this emoji, used to modify properties of the emoji like name and role restrictions.
You modify multiple fields in one request by chaining setters before callingRestAction.queue()
.- Specified by:
getManager
in interfaceRichCustomEmoji
- Returns:
- The CustomEmojiManager for this emoji
-
isAnimated
public boolean isAnimated()Description copied from interface:CustomEmoji
Whether this emoji is animated.- Specified by:
isAnimated
in interfaceCustomEmoji
- Returns:
- True, if this emoji is animated
-
delete
Description copied from interface:RichCustomEmoji
Deletes this emoji.Possible ErrorResponses include:
UNKNOWN_EMOJI
If this emoji was already removedUNKNOWN_GUILD
If the Guild of this emoji was deletedMISSING_ACCESS
If we were removed from the Guild
- Specified by:
delete
in interfaceRichCustomEmoji
- Returns:
AuditableRestAction
The RestAction to delete this emoji.
-
setName
-
setAnimated
-
setManaged
-
setAvailable
-
setOwner
-
getRoleSet
-
equals
-
hashCode
public int hashCode() -
toString
-
copy
-
asUnicode
Description copied from interface:EmojiUnion
Returns the underlyingUnicodeEmoji
if applicable.- Specified by:
asUnicode
in interfaceEmojiUnion
- Returns:
- The
UnicodeEmoji
-
asCustom
Description copied from interface:EmojiUnion
Returns the underlyingCustomEmoji
if applicable.- Specified by:
asCustom
in interfaceEmojiUnion
- Returns:
- The
CustomEmoji
-
asRich
Description copied from interface:EmojiUnion
Returns the underlyingRichCustomEmoji
if applicable.- Specified by:
asRich
in interfaceEmojiUnion
- Returns:
- The
RichCustomEmoji
-
asApplication
Description copied from interface:EmojiUnion
Returns the underlyingApplicationEmoji
if applicable.- Specified by:
asApplication
in interfaceEmojiUnion
- Returns:
- The
ApplicationEmoji
-