I have a bot that sends embeds. Sometimes I send embeds with a picture, but I want to put a spoiler over it. Is that possible? The problem is that I get the image from a link, so I can't rename it to 'SPOILER_'. Downloading the image and renaming it would be very troublesome, there must be another way. This is how the code I insert the image with:
{
"embed": {
"image": {
"url": url
}
}
}
Unfortunately, this is not possible via renaming the image file with SPOILER_
Taken from the docs, with TextChannel.send() you're able to fetch an image, rename it and then send it in an embed, like so:
channel.send({
embed: {
image: {
url: "attachment://SPOILER_FILE.jpg"
}
},
files: [{
attachment: "https://cdn.pixabay.com/photo/2018/04/05/18/28/cute-3293750_960_720.jpg",
name: "SPOILER_FILE.jpg"
}]
});
But if you test this out, the image will still be visible.

However, if you remove the embed part of the message, it works:
channel.send({
files: [{
attachment: "https://cdn.pixabay.com/photo/2018/04/05/18/28/cute-3293750_960_720.jpg",
name: "SPOILER_FILE.jpg"
}]
});

So what now?
Give them feedback: upvote and comment on this suggestion and other places to let them know, and hopefully they'll add it soon.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With