A Discord bot that automatically tracks CTF (Capture The Flag) events from CTFtime.org and sends notifications when new competitions are announced.
Before getting started, you'll need:
- Python 3.13 and uv package manager
- Discord Bot Application with proper permissions
- Visit the Discord Developer Portal and create a new application
- Navigate to the "Bot" section and copy your bot token (keep this secure!)
- Configure the following bot permissions:
- Send Messages - Allow the bot to post CTF announcements
- Manage Messages - Enable the bot to manage its own messages
- Generate an invite link and add the bot to your Discord server
The fastest way to get CTFeed running is through our automated Docker deployment.
Get up and running in just two commands:
git clone https://github.com/ICEDTEACTF/CTFeed && cd CTFeed
./setup_env.shThe setup_env.sh script will:
- Check Docker requirements
- Help you create the
.envfile with Discord bot configuration - Offer to run the bot with Docker immediately
Once setup is complete, manage your bot with:
./run.shOr run Docker commands directly:
sudo docker-compose up -d --build # Run in background
sudo docker-compose up --build # Run with live logsPrefer to set things up manually? Here's the traditional approach:
- uv and Python 3.13
- Docker and Docker Compose
uv syncStart by copying the example configuration:
cp .env.example .envThen edit the .env file with your specific settings. Focus on these key variables:
| Variable | Description | Example |
|---|---|---|
DISCORD_BOT_TOKEN |
Your Discord bot token | MTIzNDU2Nzg5... |
CHECK_INTERVAL_MINUTES |
How often to check for new CTFs | 30 (default) |
ANNOUNCEMENT_CHANNEL_ID |
Channel name for announcements | ctf-announcements |
Other configuration options can remain at their default values.
Choose your preferred method:
# With uv (recommended)
uv run python ctfeed.py
# Or with Python directly
python3 ctfeed.pyUse our user-friendly script for easy bot management:
./run.shThe run.sh script provides an interactive menu for Docker deployment options:
- Docker (background) - Recommended for production
- Docker (foreground) - See live logs
- Exit
Docker command cheatsheet for this bot:
| Action | Command | Description |
|---|---|---|
| Start | sudo docker-compose up -d --build |
Launch bot in background |
| Monitor | sudo docker-compose logs -f ctfeed |
View live logs |
| Stop | sudo docker-compose down |
Gracefully stop the bot |
| Restart | sudo docker-compose restart ctfeed |
Quick restart without rebuild |
Once running, the bot will:
- Automatically check CTFtime.org for new CTF events
- Post announcements in your designated Discord channel
- Use
data/known_events.jsonto track announced events and avoid duplicates