🚀 A Smart Telegram Bot Using Google's Gemini AI for Text, Image, Audio Processing & Image Generation
This Telegram bot integrates Google's Gemini AI to provide users with AI-powered text, image, and audio processing, plus AI image generation! 🤩
With natural language understanding, computer vision, and speech-to-text capabilities, this bot can:
✅ Process text queries & provide AI-generated responses 📝
✅ Analyze images and answer questions based on image content 🖼️
✅ Transcribe & answer questions from audio files 🎙️
✅ Generate AI images from text prompts using /imagine 🎨
🔹 Conversational AI - Responds intelligently to text messages
🔹 Image Understanding - Processes images & captions for analysis
🔹 Audio Analysis - Extracts speech from audio and answers questions
🔹 AI Image Generation - Generates images using the /imagine command
🔹 Secure API Handling - Uses .env files to protect API keys 🔐
🔹 Fast & Reliable - Uses efficient polling for real-time interaction
-
Python 🐍
-
Telegram Bot API 🤖
-
Google Gemini AI API ⚡
-
Pillow (PIL) 🖼️
-
dotenv for environment variable management 🌍
-
requests for API calls 🌐
git clone https://github.com/furious-coder09/ai-telegrambot
cd telegram-gemini-bot
pip install -r requirements.txt
Create a .env file in the project root and add your API keys:
BOT_TOKEN=your-telegram-bot-token
GEMINI_API_KEY=your-google-api-key
python bot.py
The bot will start and begin responding to messages in your Telegram chat! 🎉
💬 Send a text message → The bot will reply with AI-generated content.
📸 Send an image (with or without a caption) → The bot will analyze it and respond.
🎧 Send an audio file (OGG format) → The bot will transcribe and answer questions based on the audio content.
🚨 DO NOT expose your BOT_TOKEN or GEMINI_API_KEY publicly!
✅ Always use .env files to store sensitive credentials.
✅ Add .env to .gitignore to prevent accidental uploads.
Contributions are welcome! 🛠 If you'd like to improve this bot, feel free to fork this repo, make changes, and submit a pull request.
This project is licensed under the MIT License.
If you found this bot useful, consider starring 🌟 the repo to support development!
🚀 Happy Coding!