Class CustomEmojiBuilder



  • public class CustomEmojiBuilder
    extends Object
    This class is used to create new custom emojis.
    • 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.