A bot for Discord in NodeJs to play music from YouTube with a queue system and slash command support.
- Clone the repository using the
<> Code
button
git clone https://github.com/jjr-dev/ytb-music-discord-bot.git
- Create the
configs.json
configuration file
{
"token": "discord_bot_token",
"client": "discord_bot_id"
}
Settings credentials can be obtained here
-
Add the bot to your server. If you don't know how to do it, click here.
-
Install the dependencies and start the bot
npm install
npm start
- Add the slash commands with the
deploy-commands.js
file
node deploy-commands.js
The bot supports slash commands and therefore its usability is quite simple and fast. The available commands are:
/ping
Get ping from server/play [music*]
| Play or add a song/pause
Pause a song/skip
Skip a song/repeat
Repeat a song/leave
Stop playing song/queue [page]
List songs queue/volume [volume]
Change song volumeVolume can be set between
0.1
and infinity, where1
is100%
.
Submitting music for playback can be performed by name (or part of it), video URL or playlist URL, examples:
/play Lil Nas X - HOLIDAY
/play https://youtu.be/9vMLTcftlyI
/play https://www.youtube.com/watch?v=9vMLTcftlyI&ab_channel=LilNasXVEVO
/play https://www.youtube.com/watch?v=6swmTBVI83k&list=PLaJrsJZtcK8O_X5xxvfidfMtB8Z8uycvo
Feel free to make changes, suggest updates or use it on your servers. A single instance can play music on multiple servers simultaneously.