Package org.javacord.api.entity.emoji
Class CustomEmojiBuilder
- java.lang.Object
-
- org.javacord.api.entity.emoji.CustomEmojiBuilder
-
public class CustomEmojiBuilder extends Object
This class is used to create new custom emojis.
-
-
Constructor Summary
Constructors Constructor Description CustomEmojiBuilder(Server server)Creates a new custom emoji builder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CustomEmojiBuilderaddRoleToWhitelist(Role role)Adds a role to the whitelist.CompletableFuture<KnownCustomEmoji>create()Creates the custom emoji.CustomEmojiBuildersetAuditLogReason(String reason)Sets the reason for the creation.CustomEmojiBuildersetImage(byte[] image)Sets the image of the emoji.CustomEmojiBuildersetImage(byte[] image, String type)Sets the image of the emoji.CustomEmojiBuildersetImage(BufferedImage image)Sets the image of the emoji.CustomEmojiBuildersetImage(BufferedImage image, String type)Sets the image of the emoji.CustomEmojiBuildersetImage(File image)Sets the image of the emoji.CustomEmojiBuildersetImage(InputStream image)Sets the image of the emoji.CustomEmojiBuildersetImage(InputStream image, String type)Sets the image of the emoji.CustomEmojiBuildersetImage(URL image)Sets the image of the emoji.CustomEmojiBuildersetImage(Icon image)Sets the image of the emoji.CustomEmojiBuildersetName(String name)Sets the name of the emoji.CustomEmojiBuildersetWhitelist(Collection<Role> roles)Sets the roles which should be whitelisted.CustomEmojiBuildersetWhitelist(Role... roles)Sets the roles which should be whitelisted.
-
-
-
Constructor Detail
-
CustomEmojiBuilder
public CustomEmojiBuilder(Server server)
Creates a new custom emoji builder.- Parameters:
server- The server of the custom emoji.
-
-
Method Detail
-
setAuditLogReason
public CustomEmojiBuilder setAuditLogReason(String reason)
Sets the reason for the creation. 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 CustomEmojiBuilder setName(String name)
Sets the name of the emoji.- Parameters:
name- The name of the emoji.- Returns:
- The current instance in order to chain call methods.
-
setImage
public CustomEmojiBuilder setImage(Icon image)
Sets the image of the emoji.- Parameters:
image- The image of the emoji.- Returns:
- The current instance in order to chain call methods.
-
setImage
public CustomEmojiBuilder setImage(URL image)
Sets the image of the emoji.- Parameters:
image- The image of the emoji.- Returns:
- The current instance in order to chain call methods.
-
setImage
public CustomEmojiBuilder setImage(File image)
Sets the image of the emoji.- Parameters:
image- The image file of the emoji.- Returns:
- The current instance in order to chain call methods.
-
setImage
public CustomEmojiBuilder setImage(BufferedImage image)
Sets the image of the emoji. This method assumes that the provided image is a png.- Parameters:
image- The image of the emoji.- Returns:
- The current instance in order to chain call methods.
-
setImage
public CustomEmojiBuilder setImage(BufferedImage image, String type)
Sets the image of the emoji.- Parameters:
image- The image of the emoji.type- The type of the image, e.g. "png", "jpg" or "gif".- Returns:
- The current instance in order to chain call methods.
-
setImage
public CustomEmojiBuilder setImage(byte[] image)
Sets the image of the emoji. This method assumes that the provided image is a png.- Parameters:
image- The image of the emoji.- Returns:
- The current instance in order to chain call methods.
-
setImage
public CustomEmojiBuilder setImage(byte[] image, String type)
Sets the image of the emoji.- Parameters:
image- The image of the emoji.type- The type of the image, e.g. "png", "jpg" or "gif".- Returns:
- The current instance in order to chain call methods.
-
setImage
public CustomEmojiBuilder setImage(InputStream image)
Sets the image of the emoji. This method assumes that the provided image is a png.- Parameters:
image- The image of the emoji.- Returns:
- The current instance in order to chain call methods.
-
setImage
public CustomEmojiBuilder setImage(InputStream image, String type)
Sets the image of the emoji.- Parameters:
image- The image of the emoji.type- The type of the image, e.g. "png", "jpg" or "gif".- Returns:
- The current instance in order to chain call methods.
-
addRoleToWhitelist
public CustomEmojiBuilder addRoleToWhitelist(Role role)
Adds a role to the whitelist. To be active, the whitelist must at least contain one role, otherwise everyone can use the emoji!- Parameters:
role- The role to add.- Returns:
- The current instance in order to chain call methods.
-
setWhitelist
public CustomEmojiBuilder 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 CustomEmojiBuilder 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.
-
create
public CompletableFuture<KnownCustomEmoji> create()
Creates the custom emoji.- Returns:
- The created custom emoji.
-
-