message.channel.sendMessage(text).attachments
["",{url:"http://openweathermap.org/img/w/"+icon+".png" }];
I made some bot, with node-js ( discord.js )
.
I want to send message with picture(without URL) so, I found fuction attachments, in documentation. But, when I put in message (text) and attachments some picture, in the console,I get:
"Cannot read property '# < Object >' of undefined"
What should I do fix this problem?
According to the docs, you will need to pass an object containing the file URL or a FileOptions object. You would do this like
message.channel.send("some text", {
file: "http://link.to/your.file" // Or replace with FileOptions object
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With