How to use local file as thumbnail in Discord JDA embedded message?

798 Views Asked by At

I want to set the Thumbnail of an Embed to an Image which is local on my pc.

Is this possible?

EmbedBuilder builder = new EmbedBuilder();
builder.setThumbnail("1.png"); //relative path
2

There are 2 best solutions below

1
On
 * Sets the Thumbnail of the embed.
 * MessageChannel channel; // = reference of a MessageChannel
 * EmbedBuilder embed = new EmbedBuilder();
 * InputStream file = new URL("https://http.cat/500").openStream();
 * embed.setThumbnail("attachment://cat.png") // we specify this in sendFile as "cat.png"
 *      .setDescription("This is a cute cat :3");
 * channel.sendFiles(FileUpload.fromData(file, "cat.png")).setEmbeds(embed.build()).queue();
0
On

Your question is similar to this question (instead of using embed.setImage you obviously use embed.setThumbnail)