← All projects

dice-bot

Python · Discord · Docker · MIT

dice-bot is a Discord bot that rolls dice. I built it in about two hours as a quick project, and it now runs around the clock on my home server.

How it works

It's a single Python script (main.py) that connects to Discord with a bot token and responds to dice commands in chat. The token lives in a .env file, kept out of the code, and the dependencies are listed in requirements.txt.

Where it runs

The bot is hosted on my home lab, an old laptop running Debian. It runs as a Docker container managed with Portainer, so it restarts by itself if anything goes wrong.

Run your own

git clone https://github.com/markart25/dice-bot
cd dice-bot
pip install -r requirements.txt

# put your Discord bot token in .env, then:
python main.py

The code is open, so feel free to reuse it as a starting point for your own bot.

View on GitHub →