public final class GuildEmoji extends Object implements Entity
Constructor and Description |
---|
GuildEmoji(ServiceMediator serviceMediator,
GuildEmojiBean data,
long guildId)
Constructs a
GuildEmoji with an associated ServiceMediator and Discord data. |
Modifier and Type | Method and Description |
---|---|
String |
asFormat()
Gets the formatted version of this emoji (i.e., to display in the client).
|
Mono<Void> |
delete()
Requests to delete this emoji.
|
Mono<Void> |
delete(String reason)
Requests to delete this emoji while optionally specifying a reason.
|
Mono<GuildEmoji> |
edit(Consumer<? super GuildEmojiEditSpec> spec)
Requests to edit this guild emoji.
|
boolean |
equals(Object obj) |
DiscordClient |
getClient()
Gets the DiscordClient associated to this object.
|
Mono<Guild> |
getGuild()
Requests to retrieve the guild this emoji is associated to.
|
Snowflake |
getGuildId()
Gets the ID of the guild this emoji is associated to.
|
Snowflake |
getId()
Gets the Snowflake that uniquely identifies this entity.
|
Mono<Image> |
getImage()
Gets the image for this guild emoji.
|
String |
getImageUrl()
Gets the URL for this guild emoji.
|
String |
getName()
Gets the emoji name.
|
Set<Snowflake> |
getRoleIds()
Gets the IDs of the roles this emoji is whitelisted to.
|
Flux<Role> |
getRoles()
Requests to retrieve the roles this emoji is whitelisted to.
|
Mono<User> |
getUser()
Requests to retrieve the user that created this emoji.
|
int |
hashCode() |
boolean |
isAnimated()
Gets whether this emoji is animated.
|
boolean |
isManaged()
Gets whether this emoji is managed.
|
boolean |
requiresColons()
Gets whether this emoji must be wrapped in colons.
|
String |
toString() |
public GuildEmoji(ServiceMediator serviceMediator, GuildEmojiBean data, long guildId)
GuildEmoji
with an associated ServiceMediator and Discord data.serviceMediator
- The ServiceMediator associated to this object, must be non-null.data
- The raw data as represented by Discord, must be non-null.guildId
- The ID of the guild this emoji is associated to.public DiscordClient getClient()
DiscordObject
getClient
in interface DiscordObject
public Snowflake getId()
Entity
public String getName()
public Set<Snowflake> getRoleIds()
public Flux<Role> getRoles()
The returned Flux
will emit items in order based off their natural position, which is indicated
visually in the Discord client. For roles, the "lowest" role will be emitted first.
public boolean requiresColons()
true
if this emoji must be wrapped in colons, false
otherwise.public boolean isManaged()
true
if this emoji is managed, false
otherwise.public boolean isAnimated()
true
if this emoji is animated, false
otherwise.public Snowflake getGuildId()
public Mono<GuildEmoji> edit(Consumer<? super GuildEmojiEditSpec> spec)
spec
- A Consumer
that provides a "blank" GuildEmojiEditSpec
to be operated on.Mono
where, upon successful completion, emits the edited GuildEmoji
. If an error is
received, it is emitted through the Mono
.public Mono<Void> delete()
Mono
where, upon successful completion, emits nothing; indicating the emoji has been deleted.
If an error is received, it is emitted through the Mono
.public Mono<Void> delete(@Nullable String reason)
reason
- The reason, if present.Mono
where, upon successful completion, emits nothing; indicating the emoji has been deleted.
If an error is received, it is emitted through the Mono
.public String getImageUrl()
public String asFormat()