Interface RichCustomEmoji
- All Superinterfaces:
CustomEmoji
,Emoji
,Formattable
,IMentionable
,ISnowflake
,SerializableData
This does not represent unicode emojis like they are used in the official client!
The format :smiley:
is a client-side alias which is replaced by the unicode emoji, not a custom emoji.
-
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
ICON_URL
-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
canInteract
(Member issuer) Whether the specified Member can interact with this emojidefault boolean
canInteract
(User issuer, MessageChannel channel) Whether the specified User can interact with this emoji within the provided MessageChannel
Same logic ascanInteract(issuer, channel, true)
!default boolean
canInteract
(User issuer, MessageChannel channel, boolean botOverride) Whether the specified User can interact with this emoji within the provided MessageChannel
Special override to exclude elevated bot permissions in case of (for instance) reacting to messages.delete()
Deletes this emoji.getGuild()
TheGuild
this emoji is attached to.getJDA()
TheJDA
instance of this emojiTheManager
for this emoji, used to modify properties of the emoji like name and role restrictions.getOwner()
The user who created this emojigetRoles()
Roles this emoji is active for.boolean
Whether this emoji is available.boolean
Whether this emoji is managed.Retrieves the owner of this emoji.Methods inherited from interface net.dv8tion.jda.api.entities.emoji.CustomEmoji
formatTo, getAsMention, getFormatted, getImage, getImageUrl, getType, isAnimated
Methods inherited from interface net.dv8tion.jda.api.entities.emoji.Emoji
getAsReactionCode, getName
Methods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getIdLong, getTimeCreated
Methods inherited from interface net.dv8tion.jda.api.utils.data.SerializableData
toData
-
Method Details
-
getGuild
TheGuild
this emoji is attached to.- Returns:
- Guild of this emoji
-
getRoles
Roles this emoji is active for.
Learn More- Returns:
- An immutable list of the roles this emoji is active for (all roles if empty)
-
isManaged
boolean isManaged()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- Returns:
- True, if this emoji is managed
-
isAvailable
boolean isAvailable()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.- Returns:
- True, if this emoji is available
-
getJDA
TheJDA
instance of this emoji- Returns:
- The JDA instance of this emoji
-
getOwner
The user who created this emojiThis is only available for manually retrieved emojis from
Guild.retrieveEmojis()
andGuild.retrieveEmojiById(long)
.
RequiresPermission.MANAGE_GUILD_EXPRESSIONS
.- Returns:
- The user who created this emoji, or null if not provided
- Throws:
IllegalStateException
- If this emoji does not have user information- See Also:
-
retrieveOwner
Retrieves the owner of this emoji.
IfgetOwner()
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.- Returns:
RestAction
- Type:User
- Throws:
InsufficientPermissionException
- If the currently logged in account does not havePermission.MANAGE_GUILD_EXPRESSIONS
in this guild- See Also:
-
delete
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
- Returns:
AuditableRestAction
The RestAction to delete this emoji.- Throws:
UnsupportedOperationException
- If this emoji is managed by discord (isManaged()
)InsufficientPermissionException
- if the PermissionMANAGE_GUILD_EXPRESSIONS
is not given
-
getManager
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()
.- Returns:
- The CustomEmojiManager for this emoji
- Throws:
InsufficientPermissionException
- If the currently logged in account does not havePermission.MANAGE_GUILD_EXPRESSIONS
-
canInteract
Whether the specified Member can interact with this emoji- Parameters:
issuer
- The User to test- Returns:
- True, if the provided Member can use this emoji
-
canInteract
Whether the specified User can interact with this emoji within the provided MessageChannel
Same logic ascanInteract(issuer, channel, true)
!- Parameters:
issuer
- The User to testchannel
- The MessageChannel to test- Returns:
- True, if the provided Member can use this emoji
-
canInteract
Whether the specified User can interact with this emoji within the provided MessageChannel
Special override to exclude elevated bot permissions in case of (for instance) reacting to messages.- Parameters:
issuer
- The User to testchannel
- The MessageChannel to testbotOverride
- Whether bots can use non-managed emojis in other guilds- Returns:
- True, if the provided Member can use this emoji
-