Docker Discord Bot - mirpag/Docker-Discord-Bot Wiki

Using VM: docker01

💡 docker and docker-compose should already be installed to continue. You should also have a discord account and discord server ready to go!

Creating a bot

Head over to Discord’s Developer Portal. Under the Applications tab, click the “New Applications” button next to your profile photo.

image

image

Then, enter in your bot name and any additional general information you want to.

image

Obtaining your bot token

Now, navigate to the “Bot” tab on the left side of your screen in the menu.

image

In the Bot screen under “Build a bot”, click the add bot button.

image

And then confirm by clicking “Yes, do it!”

image

Now, you can obtain your token for the docker portion!

image

Note: before running the container, make sure these settings under the bot tab are selected! It won’t work without it.

image

Setting up the download

To set up this bot, we followed this github by PhasecoreX!

https://github.com/PhasecoreX/docker-red-discordbot

Run the following command in docker01:

docker run -v /local_folder_for_persistence:/data -e TOKEN=bot_token -e PREFIX=. phasecorex/red-discordbot

You can also specify this information as docker-compose.yml file like this:

image

Running the container

Run the docker-compose up -d and you should see this message:

image

After the container is downloaded, there will be an invite link below the “Red-Discord Bot” title. Use that link to invite your bot to your server, and start using it!

image

image

References

  1. https://www.writebots.com/discord-bot-token/#:~:text=A%20Discord%20Bot%20Token%20is,generate%20a%20Discord%20Bot%20Token.
  2. https://github.com/PhasecoreX/docker-red-discordbot
  3. https://hub.docker.com/r/jonasbonno/discordbot