Discord bot for music broadcasting.
- Install Node.js (latest version is preferable)
- Install FFmpeg (Windows | Linux | macOS | or just run
npm i -g ffmpeg-binaries
) - Clone the project
npm install --prod
(oryarn --prod
if you have Yarn)- Set up your Discord bot here
- Set up
config.json
(you can also use arguments instead) - If you are using a stream, then step 8 can be skipped
- Create folder
"music"
and place audiofiles inside npm start
(oryarn start
if you have Yarn)
NOTE: Heroku deployment doesn't support playing from files. You should play the YouTube playlist or the video.
- Sign up in Heroku and download Heroku CLI. Also download Git.
- Clone the project
heroku create project_name_goes_here
- Add the FFMPEG buildpack by running:
heroku buildpacks:add https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest.git
git push heroku master
- Open Heroku Dashboard, find your new app's page, open up the Settings section and add config vars
token
androomId
. (Also add optional settings)
Options picking priority:
- Arguments
./config.json
- Environment variables
If you use the bot witout config.json
you have to use at least two args - --token
and --roomId
and --volume
.
npm start -- --token your_token_here --roomId 441341872296951822
If you want to play a YouTube stream you should specify the --stream
argument:
npm start -- --token your_token_here --roomId 441341872296951822 --stream https://www.youtube.com/watch?v=QKYfTUTwowk
If you already have the config.json
, all the arguments become optional. But if you specify arguments, they replace options in config file.
Here's the full list of possible arguments
{
"token": "your bot's access token goes right here",
"roomId": "rooms_id_goes_here",
"volume": 0.5,
"showSongName": true,
"stream": "https://www.youtube.com/watch?v=QKYfTUTwowk",
"playlist": "https://www.youtube.com/playlist?list=PLD0C7C075F4BB68E9"
}
--token
: String
Your bot's token.
--roomId
: String
Id of the channel the bot will try to enter into.
--volume
: Number (optional)
Music's volume from 0
to 1
. Default value is 1
.
--showSongName
: String (optional)
Enables showing the current's song filename. Works only when bot is playing the music from file system.
--stream
: String (optional)
Makes bot play audiotrack from this URL. Support Youtube only. Don't specify it if you want to play your music from ./music/
folder!
--playlist
: String (optional)
Makes bot play audiotrack from this URL. Support Youtube only. If not specified, the app will play music from the stream
option.
Logo design by eightonesix / Freepik. Heavily modified by me.