Package org.javacord.api.entity.emoji
Class CustomEmojiUpdater
- java.lang.Object
-
- org.javacord.api.entity.emoji.CustomEmojiUpdater
-
public class CustomEmojiUpdater extends Object
This class can be used to update known custom emojis.
-
-
Constructor Summary
Constructors Constructor Description CustomEmojiUpdater(KnownCustomEmoji emoji)
Creates a new custom emoji updater.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CustomEmojiUpdater
addRoleToWhitelist(Role role)
Queues a role to be added to the whitelist.CustomEmojiUpdater
removeRoleFromWhitelist(Role role)
Queues a role to be removed from the whitelist.CustomEmojiUpdater
removeWhitelist()
Queues the whitelist to be removed.CustomEmojiUpdater
setAuditLogReason(String reason)
Sets the reason for this update.CustomEmojiUpdater
setName(String name)
Queues the name to be updated.CustomEmojiUpdater
setWhitelist(Collection<Role> roles)
Sets the roles which should be whitelisted.CustomEmojiUpdater
setWhitelist(Role... roles)
Sets the roles which should be whitelisted.CompletableFuture<Void>
update()
Performs the queued updates.
-
-
-
Constructor Detail
-
CustomEmojiUpdater
public CustomEmojiUpdater(KnownCustomEmoji emoji)
Creates a new custom emoji updater.- Parameters:
emoji
- The custom emoji to update.
-
-
Method Detail
-
setAuditLogReason
public CustomEmojiUpdater setAuditLogReason(String reason)
Sets the reason for this update. This reason will be visible in the audit log entry(s).- Parameters:
reason
- The reason for this update.- Returns:
- The current instance in order to chain call methods.
-
setName
public CustomEmojiUpdater setName(String name)
Queues the name to be updated.- Parameters:
name
- The new name of the emoji.- Returns:
- The current instance in order to chain call methods.
-
addRoleToWhitelist
public CustomEmojiUpdater addRoleToWhitelist(Role role)
Queues a role to be added to the whitelist.- Parameters:
role
- The role to add.- Returns:
- The current instance in order to chain call methods.
-
removeRoleFromWhitelist
public CustomEmojiUpdater removeRoleFromWhitelist(Role role)
Queues a role to be removed from the whitelist. To be active, the whitelist must at least contain one role, otherwise everyone can use the emoji!- Parameters:
role
- The role to remove.- Returns:
- The current instance in order to chain call methods.
-
removeWhitelist
public CustomEmojiUpdater removeWhitelist()
Queues the whitelist to be removed.- Returns:
- The current instance in order to chain call methods.
-
setWhitelist
public CustomEmojiUpdater setWhitelist(Collection<Role> roles)
Sets the roles which should be whitelisted. To be active, the whitelist must at least contain one role, otherwise everyone can use the emoji!- Parameters:
roles
- The roles which should be whitelisted.- Returns:
- The current instance in order to chain call methods.
-
setWhitelist
public CustomEmojiUpdater setWhitelist(Role... roles)
Sets the roles which should be whitelisted. To be active, the whitelist must at least contain one role, otherwise everyone can use the emoji!- Parameters:
roles
- The roles which should be whitelisted.- Returns:
- The current instance in order to chain call methods.
-
update
public CompletableFuture<Void> update()
Performs the queued updates.- Returns:
- A future to check if the update was successful.
-
-