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 toolkit4mo 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
Mark4mo ago
Get the URL and use it to make an attachment and pass it to files
d.js docs
d.js docs4mo ago
:property: Attachment#url @14.16.3 The URL to this attachment
LukeZ
LukeZOP4mo ago
Ah okay 👍🏻 So, is it just new AttachmentBuilder(someAttachmentURL) ?
d.js docs
d.js docs4mo ago
LukeZ
LukeZOP4mo ago
I know
d.js docs
d.js docs4mo ago
:interface: MessageCreateOptions @14.16.3 The options for sending a message.
LukeZ
LukeZOP4mo ago
so I can just use the attachement I got from the command option to directly send it?
Syjalo
Syjalo4mo ago
It returns an Attachment and files array can take it
LukeZ
LukeZOP4mo ago
Ah okay, makes sense.

Did you find this page helpful?