message.channel.sendMessage(text).attachments
["",{url:"http://openweathermap.org/img/w/"+icon+".png" }];
Run Code Online (Sandbox Code Playgroud)
我做了一些机器人,使用node-js(discord.js)我想发送带图片的消息(没有URL)所以,我在文档中找到了功能附件.但是,我在消息(文本)和处理中添加了一些图片,但在控制台中,"无法读取属性'#<Object>'未定义"我应该怎么做才能解决这个问题?
小智 7
根据文档,您需要传递包含文件URL或FileOptions对象的对象.你会这样做的
message.channel.send("some text", {
file: "http://link.to/your.file" // Or replace with FileOptions object
});
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
31489 次 |
最近记录: |