A simple Discord Youtube and music bot that accepts youtube or direct music links and plays them in Discord.
Just a simple project to get me familiar with Eris...
- Pull
npm install
- Configure 'config.json' with your token information
node index.js
/forever start index.js
/pm2 start index.js
and away you go.
Note: when the bot joins a channel for the first time, it'll add a default youtube link to the queue (a 'ba dum tss' sound effect). Also please note that it takes a little bit of time to grab and extract the youtube audio stream when adding a song. The bot will tell you when the song properly gets added.
If the bot crashes for some reason, you'll have to restart it. I recommend running it under forever or pm2, which will restart it for you. After that, you'll need to ~~!join
again even though it may appear the bot is already in the channel. There's currently a (very strange) bug where songs seem to randomly skip, and another one where songs play super fast and high pitched. I honestly have no clue what black magic is going on there, so it's under investigation.
#Commands
~~!join - bot joins your voice channel.
~~!add [youtube url] - adds a song or playlist from YouTube to the queue. If you want to play a playlist, make sure that it's a playlist url and not a video with a playlist attached.
~~!addraw [mp3 url] - adds a song to the queue. Needs to be a direct stream.
~~!skip - skips the current song in the queue.
~~!kick - kicks the bot from the voice channel.
~~!np - prints the current playing song to the chat. Bot needs to have write access to the text channel.
~~!queue - prints the current queue to the chat. Bot needs to have write access to the text channel.
~~!eval - evaluates a javascript statement. Requires owner permissions.
~~!vol - adjusts the volume of the bot on the server side. Ranges from 0 to 2.0, with 1.0 = 100% volume.
- Error handling/sanity checking
- Guild config saving
- Other features