#Set image to spoiler in embeds
12 messages · Page 1 of 1 (latest)
• 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.
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
It did not work 😕
maybe this
I found this: https://discord.js.org/#/docs/discord.js/main/class/AttachmentBuilder?scrollTo=setSpoiler . Maybe that helps?
This is for text only, it says about the type being string
I think it's for text only too :/ if you put .setSpoiler(true) in an embed builder it returns .setSpoiler is not a function
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