Julian Schaefers
Julian Schaefers

Reputation: 31

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

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

Upvotes: 1

Views: 890

Answers (2)

 * 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();

Upvotes: 0

Damascus
Damascus

Reputation: 79

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

Upvotes: 0

Related Questions