回复消息时将图像添加到消息中不起作用

问题描述 投票:0回答:1

我正在尝试将图像附加到消息中,这是重播。

msg.reply(JSON.parse(data).results[0].overview, { file : JSON.parse(data).results[0].poster_path});

但是只有“ overview”夹将被发送,而没有“ poster_path”图像为什么会这样,我该如何解决?我已经检查过,并且JSON数据有效。

javascript image discord.js message imageurl
1个回答
0
投票

为了使代码更清晰并避免内存过载,您可以调用一次


   // 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以确认响应。

© www.soinside.com 2019 - 2024. All rights reserved.