节点:4UnhandledPromiseRejectionWarning:错误:未定义不是有效的uri或选项对象

问题描述

bot.onText(/\/igdl (.+)/i,async(msg,match) => {
  // 'msg' is the received Message from Telegram
  // 'match' is the result of executing the regexp above on the text content
  // of the message

  console.log("igdl command was executed")
  const chatId = msg.chat.id;
  const resp = match[1]; // the captured "whatever
  request(resp,async (error,response,html) => {
let $ = cheerio.load(html);
 url = $('Meta[property="og:url"]').attr('content');
 title = $('Meta[property="og:title"]').attr('content');
 video_link = $('Meta[property="og:video"]').attr('content');
 bot.sendMessage(chatId,"Title : " + title) 
 bot.sendMessage(chatId,"Video Link : " + video_link)
const fileOptions = {filename: title,};
  const file = await request(video_link)
bot.sendVideo(chatId,file,{},fileOptions)

  })

});

所以我发送了一个带有“AN VALID LINK”的命令 像这样

Sending valid link

但不知何故它一直说发送链接无效..

有人知道如何解决这个问题吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)