I have been trying to get my discord bot to play audio. I managed to did it locally, but because I want to host it on heroku I am now trying to play it from a youtube video since heroku cannot play songs locally using ffmpeg.
if(command==="marijuana"){ var voiceChannel = message.member.voice.channel; if(voiceChannel!=null){ voiceChannel.join().then(connection => { const dispatcher = connection.play(ytdl('https://youtu.be/fqEhB9rjbvE')); dispatcher.on("end", end => {voiceChannel.leave()});}); } }
1.4m articles
1.4m replys
5 comments
56.9k users