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 RestEmojicreate(RestClient restClient, Snowflake guildId, Snowflake id)Create aRestEmojiwith the given parameters.Mono<Void>delete(String reason)Delete this guild emoji.booleanequals(Object o)Mono<discord4j.discordjson.json.EmojiData>getData()Retrieve this guild emoji's data upon subscription.SnowflakegetGuildId()Returns the ID of the guild this emoji belongs to.SnowflakegetId()Returns the ID of this emoji.RestGuildguild()Return this emoji's parentRestGuild.inthashCode()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 aRestEmojiwith 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
RestEmojirepresented 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
RestGuildof this guild emoji.
-
getData
public Mono<discord4j.discordjson.json.EmojiData> getData()
Retrieve this guild emoji's data upon subscription.- Returns:
- a
Monowhere, upon successful completion, emits theEmojiDatabelonging 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_EMOJISpermission. Returns the updated emoji object on success.- Parameters:
request- the guild emoji modify requestreason- an optional reason for the audit log- Returns:
- a
Monowhere, upon subscription, emits the updatedEmojiDataon 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_EMOJISpermission. Returns empty on success.- Parameters:
reason- an optional reason for the audit log- Returns:
- a
Monowhere, upon subscription, emits a complete signal on success. If an error is received, it is emitted through theMono.
-
-