A comprehensive Telegram bot for tracking luxury watch prices from premium brands including Omega, Rolex, and Jaeger-LeCoultre. The bot provides real-time price monitoring, multilingual support, and personalized watch lists with automated notifications.
- ๐ Real-time Price Tracking - Monitor prices across multiple luxury watch brands
- ๐ Multilingual Support - Available in English, Russian, Ukrainian, and Polish
- ๐ฑ Interactive Interface - Intuitive inline keyboards and user-friendly navigation
- ๐พ Personal Watch Lists - Save favorite watches and track their price changes
- ๐ Automated Notifications - Get notified when prices change or new models are available
- ๐ฏ Advanced Filtering - Filter watches by price range, brand, and availability
- Omega - Complete collection with real-time pricing
- Rolex - Premium watches with availability tracking
- Jaeger-LeCoultre - Luxury timepieces with detailed specifications
- Python 3.12 - Core programming language
- aiogram 3.21.0 - Modern Telegram Bot API framework
- asyncio - Asynchronous programming for high performance
- asyncpg 0.30.0 - PostgreSQL async driver
- Selenium WebDriver 4.15.0 - Browser automation
- undetected-chromedriver 3.5.0 - Anti-detection Chrome driver
- lxml 5.3.0 - XML/HTML processing
- requests 2.32.0 - HTTP library for API calls
- PostgreSQL 13 - Primary database
- asyncpg - Async PostgreSQL adapter
- psycopg2 2.9.9 - PostgreSQL adapter
- Docker - Containerization
- docker-compose - Multi-container orchestration
- Chrome Headless - Browser automation in containers
- python-dotenv 1.0.0 - Environment variable management
- Python 3.12+
- Docker & Docker Compose
- Telegram Bot Token (from @BotFather)
- PostgreSQL (or use Docker Compose)
git clone https://github.com/Evgen-dev1989/e-commerce-telegram_bot.git
cd e-commerce-telegram_botCreate a .env file in the project root:
# Telegram Bot Configuration
token=YOUR_TELEGRAM_BOT_TOKEN
# Database Configuration
user=postgres
password=your_secure_password
database=telegram_bot
host=localhost
port=5432# Build and start all services
docker-compose up -d
# Check logs
docker-compose logs -f bot# Install dependencies
pip install -r requirements.txt
# Run database migrations (ensure PostgreSQL is running)
python main.py- RAM: Minimum 2GB (4GB recommended)
- Storage: 1GB free space
- Network: Stable internet connection for web scraping
The application uses a multi-stage Docker setup:
- Base Image:
python:3.12-slim - Chrome Installation: Google Chrome Stable + ChromeDriver
- Security: Non-root user execution
- Health Checks: PostgreSQL connection validation
-- Users table
CREATE TABLE users (
user_id BIGINT PRIMARY KEY,
username VARCHAR(255),
language VARCHAR(5) DEFAULT 'en',
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-- Watches table
CREATE TABLE watches (
id SERIAL PRIMARY KEY,
brand VARCHAR(100) NOT NULL,
model VARCHAR(255) NOT NULL,
price DECIMAL(10,2),
url TEXT,
user_id BIGINT REFERENCES users(user_id),
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);/start- Initialize bot and select language/help- Show available commands and features/language- Change interface language
- Browse Watches - View available watches by brand
- Add to Favorites - Save watches to personal list
- Price Alerts - Set up price change notifications
- Search Filters - Filter by price range and availability
The bot supports 4 languages with complete localization:
| Language | Code | Coverage |
|---|---|---|
| English | en |
100% |
| Russian | ru |
100% |
| Ukrainian | uk |
100% |
| Polish | pl |
100% |
- Dynamic Switching - Change language anytime
- Persistent Settings - Language preference saved per user
- Complete Localization - All messages, buttons, and notifications
- Cultural Adaptation - Currency and date formats
# Required
token=your_telegram_bot_token
user=database_username
password=database_password
database=database_name
host=database_host
port=database_port
# Optional
DEBUG=true
LOG_LEVEL=INFO
SCRAPING_INTERVAL=3600 # seconds- Request Delay: 2-5 seconds between requests
- Anti-Detection: Randomized user agents and headers
- Error Handling: Automatic retry with exponential backoff
- Rate Limiting: Respectful scraping practices
โโโ main.py # Core bot application
โโโ words.py # Multilingual support
โโโ config.py # Configuration management
โโโ requirements.txt # Python dependencies
โโโ Dockerfile # Container configuration
โโโ docker-compose.yml # Multi-service setup
โโโ .env # Environment variables
- FSM (Finite State Machine) - User interaction flow
- MVC Pattern - Separation of concerns
- Async/Await - Non-blocking operations
- Factory Pattern - Dynamic scraper selection
- Connection Pooling - Database connection optimization
- Async Operations - Concurrent request handling
- Caching - In-memory price data caching
- Background Tasks - Scheduled price monitoring
- Environment Variables - Sensitive data protection
- SQL Injection Prevention - Parameterized queries
- Input Validation - User input sanitization
- Secure Headers - HTTP security headers
- Non-root Containers - Docker security best practices
- Network Isolation - Container networking
- Log Sanitization - No sensitive data in logs
- Regular Updates - Dependency security updates
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
handlers=[
logging.FileHandler('bot.log'),
logging.StreamHandler()
]
)- Database Connectivity - PostgreSQL health monitoring
- Bot Status - Telegram API connection status
- Scraping Health - Website availability checks
- Container Health - Docker health checks
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Install development dependencies:
pip install -r requirements-dev.txt - Run tests:
pytest tests/ - Submit a pull request
- PEP 8 - Python style guide compliance
- Type Hints - Full type annotation
- Docstrings - Comprehensive documentation
- Testing - Unit and integration tests
This project is licensed under the MIT License - see the LICENSE file for details.
- aiogram community - Excellent Telegram Bot framework
- Selenium maintainers - Reliable web automation
- PostgreSQL team - Robust database system
- Docker community - Containerization platform
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: [your-email@example.com]
- โ Initial release with full functionality
- โ Multi-brand watch tracking
- โ Multilingual support (4 languages)
- โ Docker containerization
- โ PostgreSQL integration
- โ Automated price monitoring
Made with โค๏ธ by Evgen-dev1989