images in an embed don't load

i'm creating an embed which contains an image in it. it's been working in numerous test servers, but recently they haven't been loading at all. it's an official discord URL, taken from the user who attaches an image. it works if you open it in a browser, but the image doesn't work in the embed.
const args = message.content.split(" ");

const image = message.attachments.first();
const price = parseFloat(args[0].slice(1));
const title = args.slice(1).join(" ");

if (!price) {
return message.reply("Please send a valid price!");
}

if (!title.length) {
return message.reply("Please enter a valid title.");
}

const nickname = message.member.nickname;

const embed = new EmbedBuilder()
.setTitle(`$${price} ${title}`)
.setDescription(`Sale by ${nickname} (<@${message.member.id}>)`)
.setImage(image.attachment)
.setFooter({
text: "πŸ’΅ = BUY NOW / πŸ”ƒ = OFFER",
});

const offer = await message.channel.send({
embeds: [embed],
});
const args = message.content.split(" ");

const image = message.attachments.first();
const price = parseFloat(args[0].slice(1));
const title = args.slice(1).join(" ");

if (!price) {
return message.reply("Please send a valid price!");
}

if (!title.length) {
return message.reply("Please enter a valid title.");
}

const nickname = message.member.nickname;

const embed = new EmbedBuilder()
.setTitle(`$${price} ${title}`)
.setDescription(`Sale by ${nickname} (<@${message.member.id}>)`)
.setImage(image.attachment)
.setFooter({
text: "πŸ’΅ = BUY NOW / πŸ”ƒ = OFFER",
});

const offer = await message.channel.send({
embeds: [embed],
});
No description
No description
No description
11 Replies
d.js toolkit
d.js toolkitβ€’14mo 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! - βœ… Marked as resolved by OP
ferret
ferretOPβ€’14mo ago
npm list discord.js:
[email protected] /workspaces/bobs-buy-manager
└─┬ [email protected]
└── [email protected]
[email protected] /workspaces/bobs-buy-manager
└─┬ [email protected]
└── [email protected]
node -v: v20.8.0
monbrey
monbreyβ€’14mo ago
Nothing we can do about this on the discord.js side If you provide a valid URL, and Discord can fetch it, it'll appear
ferret
ferretOPβ€’14mo ago
welp the URL comes straight from a Discord attachment
monbrey
monbreyβ€’14mo ago
It's possibly related to this
monbrey
monbreyβ€’14mo ago
BleepingComputer
Discord will switch to temporary file links to block malware delivery
Discord will switch to temporary file links for all users by the end of the year to block attackers from using its CDN (content delivery network)Β for hosting and pushing malware.
ferret
ferretOPβ€’14mo ago
it was happening before that change as well
monbrey
monbreyβ€’14mo ago
Either way, nothing to do with discord.js
ferret
ferretOPβ€’14mo ago
okay, well thank you
monbrey
monbreyβ€’14mo ago
We just send whatever url you give it to discord as the embed image Everything else is client side
ferret
ferretOPβ€’14mo ago
it is what it is it's strange because sometimes it loads, sometimes only works on mobile, etc. thanks for your help
Want results from more Discord servers?
Add your server