Sign inSign up

twinproduction/discord-music-bot

By twinproduction

Updated almost 4 years ago

Image
4

8.1K

twinproduction/discord-music-bot repository overview

discord-music-bot

Docker pulls

This is a minimal music bot for Discord that support streaming to multiple servers concurrently.

It uses youtube-dl to search and download the video as well as ffmpeg to convert and stream the audio.

Usage

Environment variableDescriptionRequiredDefault
DISCORD_BOT_TOKENDiscord bot tokenyes""
COMMAND_PREFIXCharacter prepending all bot commands. Must be exactly 1 character, or it will default to !no!
MAXIMUM_AUDIO_DURATION_IN_SECONDSMaximum duration of audio clips in secondno480
MAXIMUM_QUEUE_SIZEMaximum number of medias that can be queued up per server/guildno10
BOT_ADMINSComma-separated list of user idsno""

Getting started

Discord
  1. Create an application
  2. Add a bot in your application
  3. Save the bot's token and set it as the DISCORD_BOT_TOKEN environment variable
  4. Go to https://discordapp.com/oauth2/authorize?client_id=<YOUR_BOT_CLIENT_ID>&scope=bot&permissions=3222592
  5. Add music bot to server
Bot commands

Assuming COMMAND_PREFIX is not defined or is set to !.

CommandDescriptionExample
!youtube, !yt, !playAdd a song to the queue!yt what is love
!skipSkip the current song
!stopSkip all songs in the queue
!helpDisplay all commands
!healthProvides information about the health of the bot
!infoProvides general information about the bot
!restartRestarts the bot. Must be admin.

Prerequisites

If you want to run it locally, you'll need the following applications:

  • youtube-dl
  • ffmpeg

Docker

Pulling from Docker Hub
docker pull twinproduction/discord-music-bot
Building image locally

Building the Docker image is done as following:

docker build . -t twinproduction/discord-music-bot

You can then run the container with the following command:

docker run -e DISCORD_BOT_TOKEN=secret --name discord-music-bot twinproduction/discord-music-bot

FAQ

How do I add my bot to a new server?

See step 4 of the Discord section.

Tag summary

Content type

Image

Digest

sha256:600d8cff3

Size

59.2 MB

Last updated

almost 4 years ago

docker pull twinproduction/discord-music-bot