Complete setup instructions for the Bitcoin Historical Events Telegram Bot.
- Python 3.11+
- Docker and Docker Compose
- Telegram Bot Token (from @BotFather)
- Bitcoin Calendar API access
- Telegram channel or chat ID
git clone <your-repo-url>
cd telegram-bot
cp env.example .envEdit .env file with your configuration:
# Telegram Bot Configuration
TELEGRAM_BOT_TOKEN=your_bot_token_here
# Russian Channel Configuration
RUSSIAN_CHAT_ID=@your_russian_channel
# English Channel Configuration
ENGLISH_CHAT_ID=@your_english_channel
# Test Channel (used for both languages when TEST_MODE=true)
TELEGRAM_TEST_CHAT_ID=@your_test_channel
# API Configuration
API_BASE_URL=http://your-api-url/api
API_KEY=your_api_key_here
# Optional Configuration
TIMEZONE=UTC| Variable | Required | Description | Example |
|---|---|---|---|
TELEGRAM_BOT_TOKEN |
Yes | Your Telegram bot token | 123456789:ABC... |
RUSSIAN_CHAT_ID |
Yes | Russian production channel | @your_russian_channel |
ENGLISH_CHAT_ID |
Yes | English production channel | @your_english_channel |
TELEGRAM_TEST_CHAT_ID |
Yes | Test channel for both languages | @your_test_channel |
API_BASE_URL |
Yes | Bitcoin Calendar API base URL | http://api.example.com/api |
API_KEY |
Yes | API authentication key | your_api_key_here |
TIMEZONE |
No | Timezone for date calculations | UTC |
docker-compose build./scripts/test-bot-en.sh./scripts/test-bot-ru.shBoth test scripts will:
- Post to your test channel (
TELEGRAM_TEST_CHAT_ID) - Use current date events for testing
- Show detailed logs
# English production bot
docker-compose up --abort-on-container-exit bitcoin-events-bot-en
# Russian production bot
docker-compose up --abort-on-container-exit bitcoin-events-bot-ruAdd to your crontab:
crontab -eAdd these lines:
# Russian bot at 12 PM UTC (3 PM Moscow time)
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# View all logs
docker-compose logs
# View specific bot logs
docker-compose logs bitcoin-events-bot-en
docker-compose logs bitcoin-events-bot-ru- Check your test channel for test posts
- Check production channels for daily posts
- Verify URLs are correctly formatted
- Confirm media (photos/videos) are posted correctly
-
Bot not posting to test channel
- Verify
TEST_MODE=trueis set in docker-compose - Check
TELEGRAM_TEST_CHAT_IDis correct
- Verify
-
API connection errors
- Verify
API_BASE_URLandAPI_KEYare correct - Check network connectivity
- Verify
-
Docker build failures
- Ensure all Python files are present
- Check Dockerfile syntax
-
Permission errors
- Ensure bot has admin rights in target channels
- Verify bot token is valid
Run with debug logging:
docker run --rm --env-file .env -e TEST_MODE=true -e LANGUAGE=en telegram-bot_bitcoin-events-bot-test