A Dockerized Telegram bot that summarize last messages in a group
Fork of derogab/summarygram
- 🤖 Telegram bot interface
- ⚙️ Command-based interaction
- 📝 Summarize recent messages in group chats
- 🧠 AI-powered summarization
- 🔌 Customizable LLM integration (OpenAI, Ollama, Cloudflare AI)
- 🐳 Docker containerized for easy deployment
Variable | Description | Default |
---|---|---|
TELEGRAM_BOT_TOKEN |
Your Telegram bot token (required) | - |
WHITELISTED_CHATS |
Comma-separated list of allowed chat IDs (optional) | - |
OPENAI_API_KEY |
Your OpenAI API key (optional, for OpenAI integration) | - |
OLLAMA_URI |
URI for the Ollama server (optional) | http://localhost:11434 |
OLLAMA_MODEL |
Model to use with Ollama (optional) | llama3.1 |
CLOUDFLARE_ACCOUNT_ID |
Cloudflare account ID (optional, for Cloudflare AI) | - |
CLOUDFLARE_AUTH_KEY |
Cloudflare authorization key (optional, for Cloudflare AI) | - |
CLOUDFLARE_MODEL |
Cloudflare model name (optional, for Cloudflare AI) | - |
REDIS_URL |
URL for the Redis server (optional) | redis://localhost:6379 |
MSG_LENGTH_LIMIT |
Minimum message length to trigger automatic summarization | 1000 |
- Open Telegram and search for @BotFather.
- Send
/newbot
command and follow the instructions. - Choose a name and username for your bot.
- Save the bot token provided by BotFather.
- Send
/setprivacy
to @BotFather. - Select your bot from the list.
- Choose "Disable" to allow the bot to read group messages.
- This is required for the bot to access and summarize group messages.
- For OpenAI: Get your API key from OpenAI Platform.
- For Ollama: No API key needed, just ensure Ollama is running locally.
- For Cloudflare AI: Get your account ID and auth key from Cloudflare Dashboard.
- Create a
.env
file in the project root with your configuration:TELEGRAM_BOT_TOKEN=your_bot_token_here OPENAI_API_KEY=your_openai_key_here # Add other variables as needed
docker compose -f docker/docker-compose.yml up -d
docker compose -f docker/docker-compose.yml down
- Add your bot to any Telegram group where you want to use it.
- The bot will automatically start monitoring messages in the group.
- If you want to restrict the bot to specific groups, add the group IDs to the
WHITELISTED_CHATS
environment variable, separated by commas, and restart the bot.
- Send
/summary
in the group chat. - The bot will analyze all available messages in the chat and provide a concise summary. The message history is automatically cleared after 8 hours of inactivity.
DolfinaBot is made with ♥ by derogab and it's released under the MIT license.
If you like this project or directly benefit from it, please consider buying me a coffee:
🔗 bc1qd0qatgz8h62uvnr74utwncc6j5ckfz2v2g4lef
⚡️ derogab@sats.mobi
💶 Sponsor on GitHub