This is the new Discord bot that supersedes the old v1 discord bot at https://github.com/jack3898/discord-youtube-bot.
A lot of music bots are private and proprietary (and lock features behind a paywall), and additionally, YouTube have been targeting large Discord bots for takedown. As this bot is open source, you can use it assured YouTube can't do anything to bring it down as you have the code on your own server and is not commercially available.
Command | What it does | Screenshot |
---|---|---|
/play | Play something straight away with a URL or search query. | |
/pause | Pause the current playing audio. | |
/resume | Unpause the bot. | |
/volume | Set the audio playback volume of the bot. Affects all listeners. | |
/enqueue | Add a video to the queue. | |
/playlist | Bulk import a playlist into the queue using a URL. | ![]() |
/controls | A message with interactive buttons to play, pause, skip and stop. It also has live video information. | ![]() |
/queue | Get a list of items in the queue. | ![]() |
/shuffle | Shuffle the queue. | |
/move | Move an item in the queue from its current position to a new one. | |
/clean | Clean the queue by removing duplicates. The bot will tell you how many duplicates were removed. | |
/start | Start playing the queue whilst the bot is inactive. | |
/stop | Stop the playing of audio and disconnect the bot. | |
/skip | Skip the current item in the queue. Disconnects if the queue is empty. | |
/search | Search and pick a video to add to the queue using an interactive dropdown. | ![]() |
/remove | With a queue number, remove a specific item from the queue. | |
/loop | Loop the queue. |
TIP: Typing "/" in the Discord text channel will give you automatic suggestions of commands and will auto-complete options as you type the command!
This bot is proudly powered with Node.js, TypeScript & Redis. It also uses the newest Discord.js v13 library which leverages the latest Discord v9 bot API!
Because of Discord.js v13 using the very new Discord v9 API, the bot leverages slash commands and interactive message components!
Advantages of v13:
!help
is not needed. Typing "/" will give you a list of commands natively in Discord.Install Docker, Docker Compose and Git for your own OS. Linux is highly recommended as a platform to host this bot on. Windows (Server) will work, but you will be missing out on a lot of performance.
Navigate into a directory you want to place the project directory in using cd
.
Clone this repository using Git: git clone https://github.com/jack3898/discord-youtube-bot-2
.
Rename .env-example
to .env
.
Fill in the requirements for the environment variables.
DISCORD_TOKEN
& CLIENT_ID
- Which you can create/find https://discord.com/developers. This bot also requires the applications.commands
permission otherwise you will not be able to use slash commands.DEV_GUILD_ID
- For developers only. You do not need to fill this in if you are not a developer.GOOGLE_API_TOKEN
- Which you can create in the Google Cloud platform https://console.cloud.google.com/apis/api/youtube.googleapis.com/credentials.Run docker-compose up --build --detach
. This will build the bot, and run it.
Note: Commands will not immediately appear in Discord, and can take up to 1 hour to register to Discord's servers. Just keep checking, and they should appear soon (assuming everything is set up properly!)
git pull
. This will not override your .env file, but it is a good idea to check the .env-example file to ensure you meet the latest environment variable requirements.docker-compose up --build
.Discord YouTube Bot, an open source Discord YouTube Bot. Copyright (C) 2021 Jack Wright
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.