A modular Python Telegram bot that automatically posts Bitcoin historical events to Telegram channels. Features clean architecture, multi-language support, and comprehensive testing.
cp env.example .env
# Edit .env with your configuration# Test English bot (posts to test channel)
./scripts/test-bot-en.sh
# Test Russian bot (posts to test channel)
./scripts/test-bot-ru.sh# Production English bot
docker-compose up --build --abort-on-container-exit bitcoin-events-bot-en
# Production Russian bot
docker-compose up --build --abort-on-container-exit bitcoin-events-bot-rutelegram-bot/
├── bot.py # Main entry point
├── config.py # Configuration management
├── api_client.py # API communication
├── message_formatter.py # Message formatting & URLs
├── telegram_client.py # Telegram posting
├── docker-compose.yml # Docker services
├── scripts/ # Test scripts
│ ├── test-bot-en.sh # English test script
│ └── test-bot-ru.sh # Russian test script
└── docs/ # Detailed documentation
Required environment variables in .env:
TELEGRAM_BOT_TOKEN=your_bot_token
RUSSIAN_CHAT_ID=@your_russian_channel
ENGLISH_CHAT_ID=@your_english_channel
TELEGRAM_TEST_CHAT_ID=@your_test_channel
API_BASE_URL=http://your-api-url/api
API_KEY=your_api_key
TIMEZONE=UTCNote: The bot checks for a valid API response containing event data. If using the test mode, ensure your test channel is correctly set in
TELEGRAM_TEST_CHAT_IDand the bot is an administrator.
- Test Mode: Posts to
TELEGRAM_TEST_CHAT_IDinstead of production channels - Safe Testing: No risk to production channels
- Both Languages: Test English and Russian bots separately
Add to crontab for daily posting. Note the use of --build is optional but recommended if you frequently update the code.
# Russian bot at 12 PM UTC
0 12 * * * cd /path/to/telegram-bot && docker-compose up --abort-on-container-exit bitcoin-events-bot-ru
# English bot at 3 PM UTC
0 15 * * * cd /path/to/telegram-bot && docker-compose up --abort-on-container-exit bitcoin-events-bot-en- ✅ Modular Architecture - Clean, maintainable code structure
- ✅ Multi-Language Support - Russian and English bots
- ✅ Smart URL Generation - Constructs proper event URLs from
url_path - ✅ Media Support - Photos, videos, and text messages
- ✅ Test Environment - Safe testing with separate test channel
- ✅ Docker Ready - Complete containerization
- ✅ Automated Posting - Cron job support