Handling attachments in ModalBuilder
Hello! I was wondering if the Modal builder is able to handle image attachments? I've been trying to use the AttachmentBuilder class but either is not the right approach or I'm missing something.
Here's the code for the ModalBuilder
When trying to run this slash command I get the following error:
Unfortunately the
AttachmentBuilder
class doesn't have any sort of setType
method (according to the error message that's what's missing).
Is there a way to achieve this in a modal or should I try a different approach? (paste image urls)
Node version: 22.2.0
Discord.js version: 14.15.2
3 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!
- ✅
Marked as resolved by OPModals do not support attachments
AttachmentBuilder is for sending attachments, not a component
Feared as much. Guess I'll have to work on another approach. Thanks for responding!