Please describe the problem you are having in as much detail as possible:
While you sending a message with content and attachment, djs sends only the attachment without the content.
Include a reproducible code sample here, if possible:
await msg.channel.send("Here's your file", new MessageAttachment(Buffer.from(result), `${Date.now()}.txt`));
Further details:
v9.2.1Operating system: Linux 4.10.0-19-generic #21-Ubuntu SMP Thu Apr 6 17:04:57 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux / Ubuntu 17.04 zesty
[ ] I found this issue while running code on a __user account__
Unless you import MessageAttachment as Attachment in your code (ala const { MessageAttachment: Attachment } = require("discord.js")), this works for me.
Make sure result isn't actually null or whatnot.
Oh hoh, I see what you mean now. The content isn't sent.
It works if you make it an object including content, and an array of files where you put in new Attachment
By the way, you forgot a $ in your template for the file name.
This does not look like D.js master as it's MessageAttachment, but I've tested the same code on master and can confirm the same issue. :thumbsup:
@Soumil07 ah, that's because the example code comes from my actual code, where I imported MessageAttachment as Attachment as because I'm lazy to change all the.. 1 reference using Ctrl+H 🤦♂️
Anyway, fixed. As well as the wrong filename mentioned by @KingDGrizzle. 👍