A simple Discord music bot with basic functionality. Please note that this bot may have bugs and has not been extensively tested.
- Run the container
- Docker only:
- Run the following command to start the bot:
docker run -d -e DISCORD_BOT_TOKEN=<discord bot token> tgerakitis/discord-music-bot
- Run the following command to start the bot:
- Docker Compose:
- Copy the example
docker-compose.yml
file and set your bot token:version: '3' services: discord-music-bot: image: tgerakitis/discord-music-bot restart: always environment: DISCORD_BOT_TOKEN: <discord bot token> # COMMAND_PREFIX: prefix of your choice, default is !
- Run
docker compose up -d
.
- Copy the example
- Docker only:
- Make sure your bot has all relevant server roles to read your text channels and is allowed to join your voice channels.
- In chat, type
!play <song of your choice>
.
- Clone this repository.
- Copy the contents of
.env-template
into a file called.env
in the root and set your bot token. - Run
docker compose up --build
in the root directory to start the bot. - Use the provided debugger settings for VS Code in
.vscode/launch.json
.
Note: For local development the default COMMAND_PREFIX
is set to !!
- Docker
- Type
!play <search text>
to add a song to the queue. - Type
!stop
to stop and disconnect the bot. - Type
!q
to list the current song queue. - Type
!skip
to skip to the next song.
DISCORD_BOT_TOKEN
- Required. Set your Discord bot token (see instructions below).COMMAND_PREFIX
- Optional. The prefix for bot commands. Default is!
.
- Go to the Discord Developer Portal and sign in to your account.
- Click the "New Application" button and give your application a name, then click "Create."
- Click the "Bot" tab on the left, name the bot and copy the API token (reset token if you can not see this options)
- Keep the bot token secure as anyone with access to it can control your bot.
- Still in the "Bot" tab, scroll down and enable the following "Privileged Gateway Intents":
PRESENCE INTENT
MESSAGE CONTENT INTENT
- Save the changes if not saved automatically.
- Go to Oauth2 > URL Generator and select the
bot
scope. - Select the following bot permissions:
GENERAL PERMISSIONS
:Read Messages/View Channels
TEXT PERMISSIONS
:Send Messages
VOICE PERMISSIONS
:Connect
VOICE PERMISSIONS
:Speak
- Follow the generated invite link to add the bot to your Discord server.
Enjoy! 🤖