Package org.javacord.api.entity.emoji
Class CustomEmojiUpdater
- java.lang.Object
-
- org.javacord.api.entity.emoji.CustomEmojiUpdater
-
public class CustomEmojiUpdater extends java.lang.ObjectThis 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 CustomEmojiUpdateraddRoleToWhitelist(Role role)Queues a role to be added to the whitelist.CustomEmojiUpdaterremoveRoleFromWhitelist(Role role)Queues a role to be removed from the whitelist.CustomEmojiUpdaterremoveWhitelist()Queues the whitelist to be removed.CustomEmojiUpdatersetAuditLogReason(java.lang.String reason)Sets the reason for this update.CustomEmojiUpdatersetName(java.lang.String name)Queues the name to be updated.CustomEmojiUpdatersetWhitelist(java.util.Collection<Role> roles)Sets the roles which should be whitelisted.CustomEmojiUpdatersetWhitelist(Role... roles)Sets the roles which should be whitelisted.java.util.concurrent.CompletableFuture<java.lang.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(java.lang.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(java.lang.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(java.util.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 java.util.concurrent.CompletableFuture<java.lang.Void> update()
Performs the queued updates.- Returns:
- A future to check if the update was successful.
-
-