2016-12-16 58 views
2
message.channel.sendMessage(text).attachments 
["",{url:"http://openweathermap.org/img/w/"+icon+".png" }]; 

我做了一些机器人,淋巴结JS(discord.js) 我想与图片(没有URL)发送消息的话,我发现机能的研究附件中的文档。 但是,我把消息(文本)和attactments一些图片,但在控制台, “不能读取属性未定义‘>#<对象’” 我应该怎么做解决这个问题?Discord.js邮件附件图片

回答

1

根据该文档,您将需要通过包含文件URL或FileOptions对象的对象。你会做到这一点像

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