Package discord4j.rest.entity
Class RestEmoji
- java.lang.Object
-
- discord4j.rest.entity.RestEmoji
-
public class RestEmoji extends Object
Represents a guild emoji entity in Discord.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static RestEmoji
create(RestClient restClient, Snowflake guildId, Snowflake id)
Create aRestEmoji
with the given parameters.Mono<Void>
delete(String reason)
Delete this guild emoji.boolean
equals(Object o)
Mono<discord4j.discordjson.json.EmojiData>
getData()
Retrieve this guild emoji's data upon subscription.Snowflake
getGuildId()
Returns the ID of the guild this emoji belongs to.Snowflake
getId()
Returns the ID of this emoji.RestGuild
guild()
Return this emoji's parentRestGuild
.int
hashCode()
Mono<discord4j.discordjson.json.EmojiData>
modify(discord4j.discordjson.json.GuildEmojiModifyRequest request, String reason)
Modify this guild emoji.
-
-
-
Method Detail
-
create
public static RestEmoji create(RestClient restClient, Snowflake guildId, Snowflake id)
Create aRestEmoji
with the given parameters. This method does not perform any API request.- Parameters:
restClient
- REST API resourcesguildId
- the ID of the guild this emoji belongs toid
- the ID of this member- Returns:
- a
RestEmoji
represented by the given parameters.
-
getGuildId
public Snowflake getGuildId()
Returns the ID of the guild this emoji belongs to.- Returns:
- The ID of the the guild this emoji belongs to.
-
getId
public Snowflake getId()
Returns the ID of this emoji.- Returns:
- The ID of this emoji
-
guild
public RestGuild guild()
Return this emoji's parentRestGuild
. This method does not perform any API request.- Returns:
- the parent
RestGuild
of this guild emoji.
-
getData
public Mono<discord4j.discordjson.json.EmojiData> getData()
Retrieve this guild emoji's data upon subscription.- Returns:
- a
Mono
where, upon successful completion, emits theEmojiData
belonging to this entity. If an error is received, it is emitted through theMono
.
-
modify
public Mono<discord4j.discordjson.json.EmojiData> modify(discord4j.discordjson.json.GuildEmojiModifyRequest request, @Nullable String reason)
Modify this guild emoji. Requires thePermission.MANAGE_EMOJIS
permission. Returns the updated emoji object on success.- Parameters:
request
- the guild emoji modify requestreason
- an optional reason for the audit log- Returns:
- a
Mono
where, upon subscription, emits the updatedEmojiData
on success. If an error is received, it is emitted through theMono
.
-
delete
public Mono<Void> delete(@Nullable String reason)
Delete this guild emoji. Requires thePermission.MANAGE_EMOJIS
permission. Returns empty on success.- Parameters:
reason
- an optional reason for the audit log- Returns:
- a
Mono
where, upon subscription, emits a complete signal on success. If an error is received, it is emitted through theMono
.
-
-