A powerful Telegram bot that transcribes and summarizes voice messages and audio files using Groq's AI models. Users can then ask questions about the transcribed content for interactive conversations.
- Voice & Audio Transcription: Supports voice messages and audio files
- AI-Powered Summaries: Provides concise summaries in multiple languages (English, Russian, Ukrainian)
- Interactive Q&A: Ask questions about transcribed content
- Whitelist System: Optional user access control with admin management
- Multi-Language Support: Responds in the same language as the input
- Auto .env Creation: Automatically creates configuration files
- Python 3.7+
- Telegram Bot Token (from @BotFather)
- Groq API Key (from Groq Console)
- Download ZIP or Git clone the repo
- ZIP download: https://github.com/LeeseTheFox/Sumvoice → Code → Download ZIP
- Git clone:
git clone https://github.com/LeeseTheFox/Sumvoice.git
-
Install dependencies
pip install -r requirements.txt
-
Run the bot
python sumvoice_bot.py
-
Configure your tokens and admin
- The bot will automatically create a
.envfile on first run - Edit the
.envfile and add your actual configuration:
TELEGRAM_TOKEN=your_actual_telegram_token GROQ_API_KEY=your_actual_groq_api_key ADMIN_ID=your_telegram_user_id
- The bot will automatically create a
-
Restart the bot
python sumvoice_bot.py
The bot uses a .env file for configuration:
# Telegram Bot Configuration
TELEGRAM_TOKEN=your_telegram_token_here
GROQ_API_KEY=your_groq_api_key_here
ADMIN_ID=your_telegram_user_id_here
# Whitelist Configuration
WHITELIST_ENABLED=false
WHITELIST_IDS=123456789,987654321| Variable | Description | Default |
|---|---|---|
TELEGRAM_TOKEN |
Your Telegram bot token | Required |
GROQ_API_KEY |
Your Groq API key | Required |
ADMIN_ID |
Your Telegram User ID (for admin privileges) | Required |
WHITELIST_ENABLED |
Enable/disable user whitelist | false |
WHITELIST_IDS |
Comma-separated list of allowed user IDs | Empty |
To set yourself as admin, you need your Telegram User ID:
- Message @userinfobot on Telegram
- Copy your User ID (numeric value)
- Add it to your
.envfile:ADMIN_ID=123456789
- Send a voice message or audio file to the bot
- Get an AI summary of the content
- Ask questions about the transcribed content
- Start fresh by sending a new voice/audio file
🎤 [Send voice message: "Today I learned about machine learning..."]
🤖 Bot: "AI summary: Discussion about machine learning concepts and applications."
💬 You: "What specific topics were mentioned?"
🤖 Bot: "The audio mentioned neural networks, supervised learning, and data preprocessing techniques."
💬 You: "Can you explain more about neural networks?"
🤖 Bot: "Based on the audio, neural networks were described as..."
| Command | Description |
|---|---|
/start |
Start the bot and get welcome message |
/help |
Show help information |
| Command | Description |
|---|---|
/whitelist [user_id] |
Add a user to the whitelist |
/toggle_whitelist |
Enable/disable the whitelist system |
The bot includes an optional whitelist system:
- Disabled by default: Bot responds to everyone
- Easy toggle: Admins can enable/disable with
/toggle_whitelist - Persistent: Settings saved automatically to
.envfile - Silent filtering: Non-whitelisted users are simply ignored
- Enable whitelist:
/toggle_whitelist - Add users:
/whitelist 123456789 - Check status:
/help(shows current state for admins)
The bot automatically detects and responds in:
- English
- Russian
- Ukrainian
For other languages, responses default to English.
python-telegram-bot- Telegram Bot API wrappergroq- Groq AI API clientpython-dotenv- Environment variable managementrequests- HTTP requests for audio processing
- Transcription:
whisper-large-v3-turbo - Summarization & Q&A:
meta-llama/llama-4-maverick-17b-128e-instruct
- Supports voice messages (
.oggformat) - Supports audio files (various formats)
- Temporary file handling with automatic cleanup
- Direct API integration with Groq's transcription service