HackTheBot is a Discord bot that sends Hack The Box updates and information towards your Discord server. It can automatically post newly released machines and challenges, forward platform notices, collect basic OSINT details, and optionally archive links. All features are configured in a single YAML file and can be turned on or off as needed
Heads Up: These scripts make heavy use of Discord’s community server features (forum threads). If you don’t want Discord sniffing through your messages (like more than anyways), temporarily enable the community server mode, create a few forums, and then disable it afterward.
- Machine Monitoring: Automatically posts upcoming HTB machines with Discord events and forum threads
- Challenge Tracking: Also monitors for new HTB challenges
- Platform Notices: Forwards HTB platform warnings and notices to Discord
- OSINT: Automatic intelligence gathering for machines and challenges including creator profiles, historical content, and statistics
- Link Archival: Optional Linkwarden integration for automatic link collection
- Unified Configuration: Single YAML config file with feature toggles
- Python 3.11+
- uv package manager
- Discord bot with appropriate permissions
- HTB API token
- Discord server with community features enabled
curl -LsSf https://astral.sh/uv/install.sh | shgit clone https://github.com/Yeeb1/HTB-Discord.git
cd HTB-Discord
uv syncuv run htb-discord generate-config
cp config.sample.yaml config.yaml
# Edit config.yaml to match your setupuv run htb-discordThe service uses a single config.yaml file for all settings:
features:
machines:
enabled: true
create_events: true # Discord scheduled events
create_forum_threads: true # Forum posts
send_announcements: true # Channel messages
poll_interval: 600 # Check every 10 minutes
challenges:
enabled: true
# Similar options...
notices:
enabled: true
poll_interval: 60 # Check every minute
osint:
enabled: false # Legcay and Disabled - OSINT now runs automatically with new machine and challenge posts
command_prefix: "!"
linkwarden:
enabled: false # Optional feature# Service management
uv run htb-discord # Start service
uv run htb-discord validate # Validate configuration
uv run htb-discord generate-config # Generate sample config
# Development
make run # Start in development mode
make lint # Run code linting
make format # Format code
make test # Run testsYour Discord server needs:
- Community features enabled (for forum channels, can be disabled after forum creation)
- Forum channels with appropriate tags:
- Machine forum: OS tags (linux, windows, etc) + difficulty tags
- Challenge forum: Category tags (web, crypto, pwn, etc.) + difficulty tags
- Voice channels for scheduled events
- Bot permissions: Send Messages, Manage Threads, Manage Events, View Channels, Embed Links
# Install as system service
sudo ./install.sh
# Service management
sudo systemctl start htb-discord
sudo systemctl status htb-discord
sudo journalctl -u htb-discord -fThe service follows a modular architecture:
src/htb_discord/
├── service.py # Main service manager
├── config.py # Configuration management
├── cli.py # Command line interface
├── modules/ # Feature modules
│ ├── machines.py # Machine monitoring
│ ├── challenges.py # Challenge tracking
│ ├── notices.py # Notice forwarding
│ ├── osint.py # OSINT commands
│ └── linkwarden.py # Link archival
└── utils/ # Shared utilities
├── database.py # SQLite management
└── discord_helpers.py # Discord utilities
Each module can be independently enabled/disabled and configured through the main config file.
uv sync --group dev # Install dev dependencies
make lint # Check code quality
make format # Format code
make typecheck # Run type checking



