public interface Emote extends ISnowflake, IMentionable, IFakeable
This does not represent unicode emojis like they are used in the official client! (:smiley: is not a custom emoji)
Modifier and Type | Method and 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 Member 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 Member can interact with this Emote within the provided MessageChannel
Special override to exclude elevated bot permissions in case of (for instance) reacting to messages. |
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. |
EmoteManagerUpdatable |
getManagerUpdatable()
An updatable 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 |
boolean |
isManaged()
Whether this emote is managed.
|
getCreationTime, getId, getIdLong
formatTo
Guild 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 is fake (IFakeable.isFake()
)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 givenAccountTypeException
- if the current account is not from AccountType#CLIENT
EmoteManager getManager()
Manager
for this emote, used to modify
properties of the emote like name and role restrictions.
This will only work for AccountType.CLIENT
.
AccountTypeException
- if this is not used with AccountType#CLIENT
java.lang.IllegalStateException
- if this emote is fakeEmoteManagerUpdatable getManagerUpdatable()
This will only work for the client account type.
This specific Manager is used to modify multiple properties at once
by setting the property and calling EmoteManagerUpdatable.update()
AccountTypeException
- if this is not used with AccountType#CLIENT
java.lang.IllegalStateException
- if this emote is fakedefault java.lang.String getImageUrl()
default java.lang.String getAsMention()
<:getName()
:getId()
>
getAsMention
in interface IMentionable
default 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)