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.
- See Also:
-
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 -
Method Summary
Modifier and TypeMethodDescriptiondefault booleancanInteract(Member issuer) Whether the specified Member can interact with this emojidefault booleancanInteract(User issuer, MessageChannel channel) Whether the specified User can interact with this emoji within the provided MessageChannel
Same logic ascanInteract(issuer, channel, true)!default booleancanInteract(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()TheGuildthis emoji is attached to.getJDA()TheJDAinstance of this emojiTheManagerfor 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.booleanWhether this emoji is available.booleanWhether 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, isAnimatedMethods inherited from interface net.dv8tion.jda.api.entities.emoji.Emoji
getAsReactionCode, getNameMethods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getIdLong, getTimeCreatedMethods inherited from interface net.dv8tion.jda.api.utils.data.SerializableData
toData
-
Method Details
-
getGuild
TheGuildthis 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 theBoostTierof 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
TheJDAinstance 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 completedRestActionwithout 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_EXPRESSIONSin 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:
AuditableRestActionThe RestAction to delete this emoji.- Throws:
UnsupportedOperationException- If this emoji is managed by discord (isManaged())InsufficientPermissionException- if the PermissionMANAGE_GUILD_EXPRESSIONSis not given
-
getManager
TheManagerfor 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
default boolean canInteract(@Nonnull User issuer, @Nonnull 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.- 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
-