A Telegram bot that generates themed posts (text + image) using the Gemini API (Google Generative AI) and sends them to a chat via the /post
command.
- Generates posts on random topics
- Text + valid cover image (or
fallback.jpg
if none) /post
command for manual triggering- Dockerized and easily deployable via
docker-compose
- aiogram 3.x — asynchronous Telegram bot framework
- Google Generative AI SDK — access to Gemini
- aiohttp — async HTTP requests
- Docker + Docker Compose — for containerization
git clone https://github.com/serejekee/echogem.git
cd telegram-content-bot
BOT_TOKEN=your_telegram_bot_token
GOOGLE_API_KEY=your_google_api_key
docker-compose up --build -d
Done! The bot will start listening for commands.
/post
— generate a post on a random topic (e.g., Space, AI, Health, etc.)
Optional: you can easily extend it to accept a custom topic in topics.txt.
my_bot/
├── bot/ # Contains the bot's main logic and handlers
│ ├── __init__.py
│ ├── main.py # Telegram bot logic
│ ├── handlers.py # Bot command handlers
│ ├── utils.py # Utility functions (like generating posts, etc.)
├── data/ # Contains all necessary data files
│ ├── prompt.txt # Add your prompt here
│ ├── topics.txt # Add your topics here
│ ├── fallback.jpg # Fallback image if there is no picture
├── Dockerfile # Docker build instructions
├── docker-compose.yml # Docker container setup
├── requirements.txt # Dependencies
├── README.md # Documentation
MIT License — free to use, adapt, and improve 🤘