Discord.js消息附件图片

message.channel.sendMessage(text).attachments ["",{url:"http://openweathermap.org/img/w/"+icon+".png" }]; 

我做了一些bot,用node-js(discord.js)我想用图片发送消息(没有URL),所以我在文档中find了函数附件。 但是,我在消息(文本)和附加一些图片,但在控制台,“无法读取属性'<<对象>'未定义”我该怎么办解决这个问题?

根据文档,您将需要传递一个包含文件URL或FileOptions对象的对象。 你会这样做

 message.channel.send("some text", { file: "http://link.to/your.file" // Or replace with FileOptions object });