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
}
}
}
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
}
}
}
Share
Improve this question
edited Nov 20, 2019 at 9:49
Christian Proschek
asked Nov 20, 2019 at 9:42
Christian ProschekChristian Proschek
711 silver badge6 bronze badges
1
- 1 Possible duplicate of Is there anyway to mark images as spoiler? – Ben Fortune Commented Nov 20, 2019 at 9:46
1 Answer
Reset to default 4Unfortunately, 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./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./photo/2018/04/05/18/28/cute-3293750_960_720.jpg",
name: "SPOILER_FILE.jpg"
}]
});
So what now?
Give them feedback: upvote and ment on this suggestion and other places to let them know, and hopefully they'll add it soon.