Package org.javacord.api.entity.emoji
Class CustomEmojiBuilder
- java.lang.Object
-
- org.javacord.api.entity.emoji.CustomEmojiBuilder
-
public class CustomEmojiBuilder extends java.lang.ObjectThis 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.java.util.concurrent.CompletableFuture<KnownCustomEmoji>create()Creates the custom emoji.CustomEmojiBuildersetAuditLogReason(java.lang.String reason)Sets the reason for the creation.CustomEmojiBuildersetImage(byte[] image)Sets the image of the emoji.CustomEmojiBuildersetImage(byte[] image, java.lang.String type)Sets the image of the emoji.CustomEmojiBuildersetImage(java.awt.image.BufferedImage image)Sets the image of the emoji.CustomEmojiBuildersetImage(java.awt.image.BufferedImage image, java.lang.String type)Sets the image of the emoji.CustomEmojiBuildersetImage(java.io.File image)Sets the image of the emoji.CustomEmojiBuildersetImage(java.io.InputStream image)Sets the image of the emoji.CustomEmojiBuildersetImage(java.io.InputStream image, java.lang.String type)Sets the image of the emoji.CustomEmojiBuildersetImage(java.net.URL image)Sets the image of the emoji.CustomEmojiBuildersetImage(Icon image)Sets the image of the emoji.CustomEmojiBuildersetName(java.lang.String name)Sets the name of the emoji.CustomEmojiBuildersetWhitelist(java.util.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(java.lang.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(java.lang.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(java.net.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(java.io.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(java.awt.image.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(java.awt.image.BufferedImage image, java.lang.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, java.lang.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(java.io.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(java.io.InputStream image, java.lang.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(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 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 java.util.concurrent.CompletableFuture<KnownCustomEmoji> create()
Creates the custom emoji.- Returns:
- The created custom emoji.
-
-