первое сообщение здесь после использования stackoverflow в качестве анонимного зрителя. В настоящее время я пытаюсь улучшить своего бота Discord, чтобы он мог играть музыку c. Я использую ytdl-core и по какой-либо причине не могу получить информацию по URL-адресу. Вы знаете почему?
Вот мой код:
const ytdl = require('ytdl-core');
const fs = require('fs');
const queue = new Map();
module.exports = {
music:function(msg, args){
play(args, msg);
}
}
async function logToChannel(msg){
const channel = msg.member.voiceChannel;
if (channel){
connection = channel.join();
}else{
return msg.reply('vous n\'êtes pas dans un channel vocal');
}
}
function play(args, msg){
logToChannel(msg);
const songInfo = ytdl(args[1]);
const currentSong = {
title : songInfo.title,
url : songInfo.url,
}
console.log(songInfo.url);
}
Спасибо за ответы ^^