discord.js saving an attachment “undefined”?
问题 I've had a problem recently with users trolling and then deleting images before I can see what they are. So I'm creating a log to download everything into a log. (yes I've instantiated fs.js already). For some reason though, when writing the file... the file is only 9 bytes big (and the content is just "undefined"). Please help. var attachment = (message.attachments).array(); attachment.forEach(function(attachment) { console.log(attachment.url); tempName = attachment.url.split("/");