How to send a file/attachment from an Attachment option on SlashCommand?

I've looked up that topic the the guide but can't find anything on how to send an attachment/file that I get from a slash command.
10 Replies
d.js toolkit
d.js toolkit2mo ago
- 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 OP
Mark
Mark2mo ago
Get the URL and use it to make an attachment and pass it to files
d.js docs
d.js docs2mo ago
:property: Attachment#url @14.16.3 The URL to this attachment
LukeZ
LukeZOP2mo ago
Ah okay 👍🏻 So, is it just new AttachmentBuilder(someAttachmentURL) ?
d.js docs
d.js docs2mo ago
LukeZ
LukeZOP2mo ago
I know
d.js docs
d.js docs2mo ago
:interface: MessageCreateOptions @14.16.3 The options for sending a message.
LukeZ
LukeZOP2mo ago
so I can just use the attachement I got from the command option to directly send it?
Syjalo
Syjalo2mo ago
It returns an Attachment and files array can take it
LukeZ
LukeZOP2mo ago
Ah okay, makes sense.
Want results from more Discord servers?
Add your server