Local image not rendering in embed

I'm trying to add a local image in an embed. Here is my code:
const attachment = new AttachmentBuilder('./storage/webcam_pic.png')
console.log(attachment)

client.channels.cache.get('1280696749689933875').send({embeds: [{
title: `Today's Image`,
image: {
url: `attachment://webcam_pic.png`
}}],
files: [attachment]
})
const attachment = new AttachmentBuilder('./storage/webcam_pic.png')
console.log(attachment)

client.channels.cache.get('1280696749689933875').send({embeds: [{
title: `Today's Image`,
image: {
url: `attachment://webcam_pic.png`
}}],
files: [attachment]
})
This is what it sends as:
No description
5 Replies
d.js toolkit
d.js toolkit3mo 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!
Spiralio
SpiralioOP3mo ago
when I send it without the image in the url it sends like this and still doesnt render:
No description
Spiralio
SpiralioOP3mo ago
I think the issue is with the png file itself. What could cause a PNG not to want to render?
PPX005
PPX0053mo ago
It won’t display in an embed Except if you use the embeds setImage
PPX005
PPX0053mo ago
discord.js Guide
Imagine a guide... that explores the many possibilities for your discord.js bot.
Want results from more Discord servers?
Add your server