Sending a text attachment

How can I upload and send a text attachment in discordjs?
3 Replies
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
MrMythical
MrMythical17mo ago
new AttachmentBuilder(buffer, { name }) Then you send that with channel.send({ files: [attachment] }) The buffer could be Buffer.from("text...") It could also not be a buffer and just be a file path/url
jr
jr17mo ago
Ah sweet thank you!