2016-12-16 109 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 
});