Skip to content

Image attached in embed? #5879

Closed Locked Answered by kyranet
BotNC asked this question in Q&A
Discussion options

You must be logged in to vote

You attach buffers by adding them to the MessageOptions in this manner:

const file = new MessageAttachment(buffer, 'image.png');
const embed = new MessageEmbed().setImage('attachment://image.png');

await channel.send({ embeds: [embed], files: [file] });

MessageEmbed#attachFiles was just an alias for the code above.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by vladfrangu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #5878 on June 19, 2021 05:49.