java.util.Formattable, IFakeable, IMentionable, ISnowflakeListedEmotepublic interface Emote extends ISnowflake, IMentionable, IFakeable
You can retrieve the creator of an emote by using Guild.retrieveEmote(Emote) followed
by using ListedEmote.getUser().
This does not represent unicode emojis like they are used in the official client! (:smiley: is not a custom emoji)
Guild.getEmoteCache() and similar.
Guild and thus might not be manageable though
getManager() or delete(). They also might lack attached roles for getRoles().ListedEmote| Modifier and Type | Method | Description |
|---|---|---|
default boolean |
canInteract(Member issuer) |
Whether the specified Member can interact with this Emote
|
default boolean |
canInteract(User issuer,
MessageChannel channel) |
Whether the specified User can interact with this Emote within the provided MessageChannel
Same logic as canInteract(issuer, channel, true)! |
default boolean |
canInteract(User issuer,
MessageChannel channel,
boolean botOverride) |
Whether the specified User can interact with this Emote within the provided MessageChannel
Special override to exclude elevated bot permissions in case of (for instance) reacting to messages. |
boolean |
canProvideRoles() |
Whether this Emote has an attached roles list.
|
AuditableRestAction<java.lang.Void> |
delete() |
Deletes this Emote.
|
default java.lang.String |
getAsMention() |
|
Guild |
getGuild() |
The
Guild this emote is attached to. |
default java.lang.String |
getImageUrl() |
A String representation of the URL which leads to image displayed within the official Discord™ client
when this Emote is used
|
JDA |
getJDA() |
The
JDA instance of this Emote |
EmoteManager |
getManager() |
The
Manager for this emote, used to modify
properties of the emote like name and role restrictions. |
java.lang.String |
getName() |
The name of this emote
|
java.util.List<Role> |
getRoles() |
Roles this emote is active for
Learn More |
default boolean |
hasRoles() |
Deprecated.
This will be replaced by
canProvideRoles() |
boolean |
isAnimated() |
Whether or not this Emote is animated.
|
boolean |
isManaged() |
Whether this emote is managed.
|
formatTogetCreationTime, getId, getIdLongGuild getGuild()
Guild this emote is attached to.
This is null if the emote is fake (retrieved from a Message)
java.util.List<Role> getRoles()
java.lang.IllegalStateException - If this Emote does not have attached roles according to canProvideRoles()canProvideRoles()@Deprecated @DeprecatedSince("3.8.0") @ReplaceWith("canProvideRoles()") default boolean hasRoles()
canProvideRoles()If this is not true then getRoles() will throw IllegalStateException.
boolean canProvideRoles()
If this is not true then getRoles() will throw IllegalStateException.
java.lang.String getName()
boolean isManaged()
@CheckReturnValue AuditableRestAction<java.lang.Void> delete()
Possible ErrorResponses include:
UNKNOWN_EMOTE
UNKNOWN_GUILD
MISSING_ACCESS
AuditableRestAction
The RestAction to delete this Emote.java.lang.IllegalStateException - if this Emote is fake (IFakeable.isFake())java.lang.UnsupportedOperationException - If this emote is managed by discord (isManaged())InsufficientPermissionException - if the Permission MANAGE_EMOTES is not givenEmoteManager getManager()
Manager for this emote, used to modify
properties of the emote like name and role restrictions.
RestAction.queue().java.lang.IllegalStateException - if this emote is fakeInsufficientPermissionException - If the currently logged in account does not have Permission.MANAGE_EMOTESboolean isAnimated()
Animated Emotes are available to Discord Nitro users as well as Bot accounts.
default java.lang.String getImageUrl()
default java.lang.String getAsMention()
<:getName():getId()>getAsMention in interface IMentionabledefault boolean canInteract(Member issuer)
issuer - The User to testPermissionUtil.canInteract(Member, Emote),
PermissionUtil.canInteract(User, Emote, MessageChannel)default boolean canInteract(User issuer, MessageChannel channel)
canInteract(issuer, channel, true)!issuer - The User to testchannel - The MessageChannel to testPermissionUtil.canInteract(Member, Emote),
PermissionUtil.canInteract(User, Emote, MessageChannel)default boolean canInteract(User issuer, MessageChannel channel, boolean botOverride)
issuer - The User to testchannel - The MessageChannel to testbotOverride - Whether bots can use non-managed emotes in other guildsPermissionUtil.canInteract(Member, Emote),
PermissionUtil.canInteract(User, Emote, MessageChannel, boolean)