Search in sources :

Example 26 with FileContainer

use of org.javacord.core.util.FileContainer in project Javacord by BtoBastian.

the class EmbedBuilderDelegateImpl method setFooter.

@Override
public void setFooter(String text, InputStream icon, String fileType) {
    footerText = text;
    footerIconUrl = null;
    if (icon == null) {
        footerIconContainer = null;
    } else {
        footerIconContainer = new FileContainer(icon, fileType);
        footerIconContainer.setFileTypeOrName(UUID.randomUUID().toString() + "." + fileType);
    }
}
Also used : FileContainer(org.javacord.core.util.FileContainer)

Example 27 with FileContainer

use of org.javacord.core.util.FileContainer in project Javacord by BtoBastian.

the class EmbedBuilderDelegateImpl method setAuthor.

@Override
public void setAuthor(String name, String url, BufferedImage icon, String fileType) {
    authorName = name;
    authorUrl = url;
    authorIconUrl = null;
    if (icon == null) {
        authorIconContainer = null;
    } else {
        authorIconContainer = new FileContainer(icon, fileType);
        authorIconContainer.setFileTypeOrName(UUID.randomUUID().toString() + "." + fileType);
    }
}
Also used : FileContainer(org.javacord.core.util.FileContainer)

Example 28 with FileContainer

use of org.javacord.core.util.FileContainer in project Javacord by BtoBastian.

the class EmbedBuilderDelegateImpl method setThumbnail.

@Override
public void setThumbnail(InputStream thumbnail, String fileType) {
    thumbnailUrl = null;
    if (thumbnail == null) {
        thumbnailContainer = null;
    } else {
        thumbnailContainer = new FileContainer(thumbnail, fileType);
        thumbnailContainer.setFileTypeOrName(UUID.randomUUID().toString() + "." + fileType);
    }
}
Also used : FileContainer(org.javacord.core.util.FileContainer)

Example 29 with FileContainer

use of org.javacord.core.util.FileContainer in project Javacord by BtoBastian.

the class EmbedBuilderDelegateImpl method setFooter.

@Override
public void setFooter(String text, BufferedImage icon, String fileType) {
    footerText = text;
    footerIconUrl = null;
    if (icon == null) {
        footerIconContainer = null;
    } else {
        footerIconContainer = new FileContainer(icon, fileType);
        footerIconContainer.setFileTypeOrName(UUID.randomUUID().toString() + "." + fileType);
    }
}
Also used : FileContainer(org.javacord.core.util.FileContainer)

Aggregations

FileContainer (org.javacord.core.util.FileContainer)29 RestRequest (org.javacord.core.util.rest.RestRequest)4 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)3 ArrayList (java.util.ArrayList)3 CompletableFuture (java.util.concurrent.CompletableFuture)3 Message (org.javacord.api.entity.message.Message)3 EmbedBuilder (org.javacord.api.entity.message.embed.EmbedBuilder)3 JsonNodeFactory (com.fasterxml.jackson.databind.node.JsonNodeFactory)2 List (java.util.List)2 MultipartBody (okhttp3.MultipartBody)2 JsonNode (com.fasterxml.jackson.databind.JsonNode)1 ArrayNode (com.fasterxml.jackson.databind.node.ArrayNode)1 BufferedImage (java.awt.image.BufferedImage)1 File (java.io.File)1 InputStream (java.io.InputStream)1 URL (java.net.URL)1 URLConnection (java.net.URLConnection)1 Arrays (java.util.Arrays)1 Collection (java.util.Collection)1 Collections (java.util.Collections)1