use of org.javacord.core.util.FileContainer in project Javacord by BtoBastian.
the class MessageBuilderBaseDelegateImpl method addAttachment.
@Override
public void addAttachment(BufferedImage image, String fileName) {
if (image == null || fileName == null) {
throw new IllegalArgumentException("image and fileName cannot be null!");
}
attachments.add(new FileContainer(image, fileName));
attachmentsChanged = true;
}
use of org.javacord.core.util.FileContainer in project Javacord by BtoBastian.
the class MessageBuilderBaseDelegateImpl method addAttachment.
@Override
public void addAttachment(Icon icon) {
if (icon == null) {
throw new IllegalArgumentException("icon cannot be null!");
}
attachments.add(new FileContainer(icon));
attachmentsChanged = true;
}
use of org.javacord.core.util.FileContainer in project Javacord by BtoBastian.
the class MessageBuilderBaseDelegateImpl method addAttachment.
@Override
public void addAttachment(InputStream stream, String fileName) {
if (stream == null || fileName == null) {
throw new IllegalArgumentException("stream and fileName cannot be null!");
}
attachments.add(new FileContainer(stream, fileName));
attachmentsChanged = true;
}
use of org.javacord.core.util.FileContainer in project Javacord by BtoBastian.
the class EmbedBuilderDelegateImpl method setImage.
@Override
public void setImage(InputStream image, String fileType) {
imageUrl = null;
if (image == null) {
imageContainer = null;
} else {
imageContainer = new FileContainer(image, fileType);
imageContainer.setFileTypeOrName(UUID.randomUUID().toString() + "." + fileType);
}
}
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, InputStream 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);
}
}
Aggregations