Skip to content

raghavTinker/discord-music-bot

Repository files navigation

discord-music-bot

Build Status
This is a discord bot that plays music in your server

a) Install everything mentioned in the requirements.txt
b) Also install ffmpeg using:

Debian based OS (Ubuntu, Raspberry Pi OS, Debian 10)
$sudo apt install ffmpeg

Using Snap
$sudo snap install ffmpeg

c)Create a bot/app in the discord developer platform
d)Create a Youtube V3 API token and note it down e)Add the youtube API tokeb variable: $export API_TOKEN=YOUR_Youtube_API_TOKEN
d)Note your discord bot TOKEN
e)Add the TOKEN variable: $export TOKEN=YOUR_TOKEN
f)Use the OAuth2 link and add the bot to your desired discord bot
g)You can change the docker bot prefix: $export PREFIX=PREFIX_CHARACTER
Example: $export PREFIX=!
h)For spotify you will have to use the developer platform. Create an app and note the ID and secret
j)Export variables: &export SPOTIFY_ID=<YOUR_SPOTIFY_DEV_ID> and $export SPOTIFY_SECRET=<SPOTIFY_DEV_SECRET>

Default character is: &

Execution

$python3 bot.py

Bot commands:

a) &join => Telling the bot to join the VC (important for playing music)
b) &play <Youtube URL> => Plays the audio from youtube url
c) &pause => Pausing the song
d) &resume => Resume music
e) &queue => Shows the music queue list
f) &skip => Skips the music to the next song
g) &stop => Stops music and clears queue
h)&shuffle=> Shuffles the queue of music

Container Usage

https://hub.docker.com/repository/docker/raghavtinker/discordmusicbot

Features:

a)Can play playlists from spotify and youtube
b)Can play single tracks from youtube urls and spotify urls
c)Can play spotify albums
d)You can also simply put the song name to play it via youtube
e)Do note: Playlists in Spotify arent streamed from it. Rather they are used to create a youtube playlist which is streamed