[英]Adding image to a message does not work when replying to a message
我正在尝试将图像附加到作为重播的消息上。
msg.reply(JSON.parse(data).results[0].overview, { file : JSON.parse(data).results[0].poster_path});
但仅发送作为字符串的“概述”,没有“poster_path”图像。
为什么会这样,我该如何解决?
我检查过,JSON 数据是有效的。
为了使您的代码更清晰并避免 memory 过载,您可以调用一次
// get first value
var firstResult = JSON.parse(data).results[0];
// confirm the result
console.log(firstResult);
// action
msg.reply(firstResult.overview, { file : firstResult.poster_path});
尝试在控制台中查看 firstResult 以确认响应。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.