Sending a text attachment

How can I upload and send a text attachment in discordjs?
3 Replies
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
MrMythical
MrMythical16mo 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
jr16mo ago
Ah sweet thank you!