Build balanced teams for ANY sport or activity!
SquadMaker is a universal, configuration-driven Telegram bot that helps you organize events and form balanced teams. Whether it's volleyball, football, basketball, work projects, or any other team-based activity, SquadMaker has you covered.
- Universal Design: Works for ANY team-based activity
- Configuration-Driven: Add new sports/activities via JSON, no code changes needed
- Seamless UX: One-click join in group chats, private position selection
- Balanced Teams: Smart algorithm distributes participants fairly
- Inline Mode: Easily share events in group chats
- Go 1.21+ (for building from source)
- Docker & Docker Compose (for containerized deployment)
- Telegram Bot Token from @BotFather
-
Clone the repository
git clone https://github.com/avpv/squad-maker-bot.git cd squad-maker-bot -
Configure environment
cp .env.example .env # Edit .env and set your TELEGRAM_BOT_TOKEN -
Start the bot
docker-compose up -d
-
Check logs
docker-compose logs -f
-
Clone and install dependencies
git clone https://github.com/avpv/squad-maker-bot.git cd squad-maker-bot make deps -
Set environment variables
export TELEGRAM_BOT_TOKEN="your_token_here" export SPORT_TYPE="volleyball" # or football, basketball, work
-
Build and run
make build make run
-
Create an Event
- Send
/createto the bot in a private chat - Follow the prompts to set name, description, and date/time
- Send
-
Publish to Group
- Go to your group chat
- Type
@YourBotName(inline mode) - Select your event from the list
- Send it to the group
-
Form Teams
- When ready, use
/formteams - Select the event
- The bot generates balanced teams!
- When ready, use
-
Join an Event
- Click β Join on the event message in your group chat
- The bot will send you a private message
-
Select Positions
- Choose your positions from the private message
- Click β Done when finished
-
Leave if Needed
- Click β Leave on the event message to cancel
SquadMaker supports two configuration modes:
Set the SPORT_TYPE environment variable:
# Available options
SPORT_TYPE=volleyball # Default
SPORT_TYPE=football
SPORT_TYPE=basketball
SPORT_TYPE=work # Work/project teamsCreate a JSON file and set SPORT_CONFIG_PATH:
SPORT_CONFIG_PATH=./configs/examples/ultimate-frisbee.jsonExample configuration:
{
"name": "Ultimate Frisbee",
"emoji": "π₯",
"positions": [
{"id": "HANDLER", "name": "Handler", "emoji": "π―"},
{"id": "CUTTER", "name": "Cutter", "emoji": "β‘"}
],
"min_players": 4,
"max_players": 7,
"default_teams": 2,
"allow_multi_pos": true,
"bot_username": "squadmakerbot",
"welcome_message": "Welcome to SquadMaker! Build balanced teams."
}See configs/examples/ for more examples.
- EXTENDING.md - How to create custom sport configurations
- ARCHITECTURE.md - System design and architecture
- BOTFATHER_SETUP.md - Complete BotFather configuration guide
| Command | Description |
|---|---|
/start |
Welcome message and quick start guide |
/help |
Detailed help information |
/create |
Create a new event (private chat only) |
/myevents |
List your active events |
/formteams |
Generate balanced teams for an event |
/cancel |
Cancel current operation |
squad-maker-bot/
βββ cmd/bot/ # Application entry point
βββ internal/
β βββ bot/ # Bot logic and handlers
β βββ database/ # SQLite database layer
β βββ models/ # Data structures
βββ config/ # Configuration loading
βββ configs/examples/ # Example sport configs
βββ migrations/ # Database migrations
βββ Dockerfile # Docker configuration
βββ docker-compose.yml # Docker Compose setup
βββ Makefile # Build automation
The bot includes complete Docker support:
# docker-compose.yml
services:
bot:
build: .
environment:
- TELEGRAM_BOT_TOKEN=${TELEGRAM_BOT_TOKEN}
- SPORT_TYPE=volleyball
volumes:
- ./data:/data # Persist databaseUseful commands:
make docker-build # Build Docker image
make docker-run # Start bot
make docker-stop # Stop bot
make docker-logs # View logsSquadMaker comes with 4 pre-configured sports:
- Positions: Setter, Opposite, Outside Hitter, Middle Blocker, Libero
- Team size: 2-6 players
- Positions: Goalkeeper, Defender, Midfielder, Forward
- Team size: 5-11 players
- Positions: Point Guard, Shooting Guard, Small Forward, Power Forward, Center
- Team size: 3-5 players
- Positions: Developer, Designer, PM, QA, DevOps, Marketing
- Team size: 2+ players (unlimited)
| Variable | Required | Default | Description |
|---|---|---|---|
TELEGRAM_BOT_TOKEN |
β Yes | - | Bot token from @BotFather |
DATABASE_PATH |
No | teambot.db |
SQLite database path |
SPORT_TYPE |
No | volleyball |
Built-in sport type |
SPORT_CONFIG_PATH |
No | - | Custom config file path |
# Install dependencies
make deps
# Build the bot
make build
# Run locally
make run
# Run tests
make test
# Format code
make fmt
# Clean build artifacts
make clean- Go: 1.21 or higher
- SQLite: 3.x (automatically included)
- Docker: 20.10+ (optional, for containerized deployment)
Contributions are welcome! Here are some ways you can help:
- π Report bugs
- π‘ Suggest new features or sport configurations
- π Improve documentation
- π§ Submit pull requests
This project is licensed under the MIT License - see the LICENSE file for details.
Built with:
- go-telegram-bot-api - Telegram Bot API wrapper
- SQLite - Database
- Go - Programming language
- π Report Issues
- π Documentation
- π¬ Telegram: @SquadMakerBot
Made with β€οΈ for team sports and collaborative activities