#Set image to spoiler in embeds

12 messages · Page 1 of 1 (latest)

silent shadow
#

I was wondering if there is any possible way to put an image to spoiler in the .setImage() parameter of embeds ?

analog flame
#

• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.

snow haven
#

IIRC spoiler images are identified by their name starting with spoiler or something like that… not sure if that works in embeds too, but it does for attachments

#

SPOILER_ is what it needs to start with

silent shadow
#

It did not work 😕

sacred raven
#

maybe this

worn inlet
worn inlet
silent shadow
worn inlet
#

Maybe it's an option you can add to .setImage? A bit like for how display avatar you can have {dynamic: true}. I'll check the docs and get back to you

#

So I had a look and I don't think images inside an embed can be made a spoiler, but you can create a MessageAttachment (new MessageAttachment() for v13), get the file and use the .setSpoiler method I showed above and then when sending, use {embeds: [embed], files: [file]} and it will attach it below the embed. I've searched the docs and the DJS guide and can't find any other way to do this as there's no options for .setImage where you could make it a spoiler. Here's a link on the v13 guide about it: https://v13.discordjs.guide/popular-topics/embeds.html#attaching-images