An animated Discord bot that selects maps for a tournament-style Worms match through spinning wheel animations.
- Tournament Format: 2 matches with strategic map selection
- Tag-Based Pairing: Maps with compatible themes face off in Match 2
- Animated Selection: Visual spinning pointer with progressive slowdown
- External Configuration: Easy map management via
maps.json
- Development Mode: Fast animations for testing
- Docker Ready: Containerized for easy deployment
- 🥇 Match 1: Both teams play the same map
- 🥈 Match 2: Winner chooses between two tag-compatible options
- Spin 1: Selects Match 1 map (any available map)
- Spin 2: Selects Match 2 Option A (from remaining maps)
- Spin 3: Selects Match 2 Option B (compatible tags with Option A)
Maps are configured in maps.json
with tags for strategic pairing:
{
"maps": [
{
"emoji": "🏰",
"name": "Burg",
"tags": ["large", "fortress"]
},
{
"emoji": "🌳",
"name": "Baum",
"tags": ["large", "nature"]
}
]
}
- 🏰 Burg -
[large, fortress]
- 🏠 Haus -
[small, cozy]
- 🚀 Rakete -
[mid, tech]
- 🌳 Baum -
[large, nature]
- 🍄 Pilz -
[small, nature]
- 🐴 Esel -
[small, mid]
- 🚢 Schiff -
[mid, water]
- ☢️ Reaktor -
[large, tech]
- Python 3.11+
- Discord bot token
- Docker (optional)
- Go to Discord Developer Portal
- Create a new application and bot
- Copy the bot token
- Invite bot to your server with these permissions:
- Send Messages
- Use Slash Commands
- Embed Links
- Clone/download the files
- Create
.env
file:DISCORD_BOT_TOKEN=your_token_here
- Ensure
maps.json
is in the same directory - Run with Docker Compose:
docker-compose up -d --build
- Install dependencies:
pip install -r requirements.txt
- Ensure
maps.json
is in the same directory asbot.py
- Set environment variable:
export DISCORD_BOT_TOKEN="your_token_here"
- Run the bot:
python bot.py
# Build the image
docker build -t worms-bot .
# Run the container with volume mount
docker run -d \
--name worms-bot \
-e DISCORD_BOT_TOKEN="your_token_here" \
-v $(pwd)/maps.json:/app/maps.json:ro \
--restart unless-stopped \
worms-bot
- Use the
/worms
slash command in any channel - Watch the 3 animated spins
- Get your tournament setup with 2 matches!
🎉 Worms Match Setup Complete!
🥇 Match 1: Both teams play
🔹 🌳 Baum 🌳
🥈 Match 2: Winner chooses
🔸 🍄 Pilz 🍄 ⚔️ 🏠 Haus 🏠 🔸
🏷️ Connected by: small
🎯 Good luck in your Worms battles!
Edit maps.json
to customize available maps. After changes:
For Python: Restart the bot For Docker: Restart the container (maps.json is mounted as volume)
docker-compose restart worms-bot
For faster testing during development:
# Faster animations
DEV_MODE=1 python bot.py
# With Docker
docker-compose up -d --build -e DEV_MODE=1
DISCORD_BOT_TOKEN
: Your Discord bot token (required)DEV_MODE
: Enable fast animations for development (optional)
You can modify these values in bot.py
:
- Normal mode: 15-22 spins, 40ms start
- Dev mode: 5-8 spins, 20ms start
- Curve factor: Adjust
progress ** 2.5
for different slowdown styles
worms-bot/
├── bot.py # Main bot code
├── maps.json # Map configuration
├── requirements.txt # Python dependencies
├── Dockerfile # Docker image configuration
├── docker-compose.yml # Docker Compose setup
├── .env # Environment variables (create this)
└── README.md # This documentation
- Check bot permissions (Send Messages, Use Slash Commands)
- Wait a few minutes for slash commands to sync
- Try restarting the bot
- Verify
maps.json
exists in the correct location - Check JSON syntax is valid
- Ensure file is accessible by the bot process
- Check console for error messages
- Verify your
.env
file has the correct token - Ensure
maps.json
exists in the same directory - Check Docker logs:
docker-compose logs worms-bot
- Verify no port conflicts
This project is open source and available under the MIT License.