A Telegram bot for monitoring webpage changes with real-time notifications. Track content changes, HTTP status code transitions, and manage your monitored URLs via Telegram commands.
- 🔔 Real-time Notifications: Get instant Telegram alerts when webpages change
- 📊 Status Code Tracking: Monitor HTTP status transitions (200→404, 500→200, etc.)
- 🔧 Telegram Commands: Full URL management via chat commands
- 📄 Content Diffs: Optional detailed change tracking with unified diffs
- 🐳 Docker Ready: Easy deployment with Docker/Dokploy
- 💾 Persistent Storage: Configuration and hashes saved to disk
Create a .env
file:
TELEGRAM_BOT_TOKEN=your_bot_token_here
TELEGRAM_CHAT_ID=your_chat_id_here
# Install dependencies
pip install -r requirements.txt
# Run the bot
python webpage_monitor.py
# Build and run
docker-compose up -d
# Or with Docker directly
docker build -t webhawkbot .
docker run -e TELEGRAM_BOT_TOKEN=your_token -e TELEGRAM_CHAT_ID=your_id webhawkbot
/add <url>
- Add URL to monitor/remove <url>
or/rm <url>
- Remove URL/list
or/ls
- List monitored URLs/clear
- Clear all URLs
/interval <seconds>
- Set check interval (min 30s)/content
or/diff
- Toggle content storage for diffs/status
- Show current status and settings
/stop
- Stop monitoring/help
- Show all commands
/add https://example.com
/interval 600
/status
monitor_config.json
- Stores URLs, interval, and settingspage_hashes.json
- Stores webpage hashes and status codes.env
- Environment variables (not committed to git)
- Build the image in your Dokploy dashboard
- Set environment variables:
TELEGRAM_BOT_TOKEN
TELEGRAM_CHAT_ID
- Mount volumes (optional, for persistence):
./monitor_config.json:/app/monitor_config.json
./page_hashes.json:/app/page_hashes.json
- Deploy!
WebHawkBot/
├── webpage_monitor.py # Main application
├── requirements.txt # Python dependencies
├── Dockerfile # Docker configuration
├── docker-compose.yml # Docker Compose setup
├── .dockerignore # Docker ignore rules
├── .gitignore # Git ignore rules
└── README.md # This file
URLManager
- Handles URL list and configuration persistenceWebpageMonitor
- Core monitoring logic and Telegram integration
- Keep your bot token secure and never commit it to version control
- The bot only responds to commands from the configured chat ID
- All data is stored locally in JSON files
- Check your bot token is correct
- Verify the chat ID matches your Telegram chat
- Ensure the bot is running and not crashed
- Check environment variables are set correctly
- Verify volume mounts if using persistent storage
- Check container logs:
docker-compose logs
- Ensure the application can write to the current directory
- Check file permissions for config files
WebHawkBot works with both private chats and Telegram channels. For channels, follow these steps:
- Open your Telegram channel
- Go to Channel Settings → Administrators
- Add Administrator → Search for
@WebHawkBot
- Grant these permissions:
- ✅ Post Messages
- ✅ Edit Messages
- ✅ Delete Messages
For channel https://t.me/c/3043629919/4
:
- Channel ID:
3043629919
- Chat ID:
-1003043629919
TELEGRAM_BOT_TOKEN=your_bot_token
TELEGRAM_CHAT_ID=-1003043629919 # Note the -100 prefix
python3 channel_setup.py
All commands work the same in channels:
/add https://example.com
/status
/help
Note: The bot will only respond to commands from channel administrators.