Attachment to Embed

How do I attach an Attachment to the Embed Image?
const attachment = new AttachmentBuilder(canvas.toBuffer(), 'lb.png');

const embed = new EmbedBuilder()
.setTitle('Leaderboard')
.setImage("attachment://lb.png")

client.channels.cache.get('1155152229842550854').send({ embeds: [embed], files: [attachment]})
const attachment = new AttachmentBuilder(canvas.toBuffer(), 'lb.png');

const embed = new EmbedBuilder()
.setTitle('Leaderboard')
.setImage("attachment://lb.png")

client.channels.cache.get('1155152229842550854').send({ embeds: [embed], files: [attachment]})
No description
2 Replies
d.js toolkit
d.js toolkit15mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
Danial
Danial15mo ago
AttachmentBuilder takes an object as the second parameter So it'd be new AttachmentBuilder(..., { name: ... })
Want results from more Discord servers?
Add your server