Bug when using AttachmentBuilder.setSpoiler
I noticed, that it is not possible to set a attachments spoiler with .setSpoiler. I have been told to ask here first, before reporting to GitHub. I also tested the text branch, and it still seems to be there.
Steps to reproduce:
- use AttachmentBuilder
- use a URL as the attachment argument
- use setSpoiler function
What should happen:
Set the spoiler, so the file later gets marked that way in discord.
What happens instead:
Throws following error:
17 Replies
• 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.Can you show your code
was about to
this is simplefied, because i was testing around alot trying to find the issue
when i removed
setSpoiler
line, it worked fine
Try setting AttachmentBuilder name
yea... that might be it
hold on
yea thats it..
it also now makes sense, why ti was reporting about a string
tho now.. not sure if this is related to it. it wont show a preview anymore
i did have a woraround that i just added "SPOILER_" infront of the filename
What is the filename
left own solution (already comited) and right is the own that doesnt show a picture preview


the SPOILER_ prefix in the image is how discord specifies if a thing should be a spoiler image, so that seems not really related to discord.js doing sth wrong
yea
does the image properly embed, if you do not spoiler it?
tho when i do it manually with
it works fine
it.. nvm its pobably linux doing a funni on me
because i just tested it again and it worked fine
can you provide a minimal sample, please? there's quite a bit of interdependency happening here
define minimal sample, please
Stack Overflow
How to create a Minimal, Reproducible Example - Help Center
Stack Overflow | The World’s Largest Online Community for Developers
unfortunately i dont quite understand what cant be understood. the bug happens, when no name is set for the file.
aka i currently dont have the time to mess with this issue. if a workaround has been found