discordjs / discord.js

A powerful JavaScript library for interacting with the Discord API
https://discord.js.org
Apache License 2.0
25.49k stars 3.97k forks source link

Cannot read property 'playRawStream' of undefined #280

Closed ghost closed 8 years ago

ghost commented 8 years ago

Hello, wanted to start off by saying this is day 1 of making a bot or dealing with Node.js/Discord.js at all so sorry if I'm ignorant to certain things this is very different from Lua. So I'm making a music bot for my clan's discord channel and I want to say Play URLHERE and it play the song from youtube unfortunately there's not really any good tutorials on this with explanation so if somebody could guide me through on this and explain it that would be great!

Posting it on hastebin since the Insert code isn't working

Script

Play https://www.youtube.com/watch?v=jfFTT3iz740 for example this doesn't work

abalabahaha commented 8 years ago

You need to have the bot join a voice channel (create a voice connection) before you can play stuff on it. Check the docs for joining voice channels

bot.voiceConnection.playRawStream(...) Cannot read property 'playRawStream' of undefined voiceConnection is undefined

ghost commented 8 years ago

How do I make it connect I have a channel named Music