Skip to content

anandjha249/ai-telegrambot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🤖 Telegram AI Bot - Powered by Gemini AI

🚀 A Smart Telegram Bot Using Google's Gemini AI for Text, Image, Audio Processing & Image Generation


📌 Overview BY SATYAM

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 🎨


🔥 Features

🔹 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


🛠 Tech Stack

  • Python 🐍

  • Telegram Bot API 🤖

  • Google Gemini AI API

  • Pillow (PIL) 🖼️

  • dotenv for environment variable management 🌍

  • requests for API calls 🌐


🚀 Installation & Setup

1️⃣ Clone the Repository

git clone https://github.com/furious-coder09/ai-telegrambot
cd telegram-gemini-bot

2️⃣ Install Dependencies

pip install -r requirements.txt

3️⃣ Create a **.env** File (For Security 🔒)

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

4️⃣ Run the Bot

python bot.py

The bot will start and begin responding to messages in your Telegram chat! 🎉


🎨 How to Use

🤖 Text Commands

💬 Send a text message → The bot will reply with AI-generated content.

🖼️ Image Analysis

📸 Send an image (with or without a caption) → The bot will analyze it and respond.

🎙️ Audio Analysis

🎧 Send an audio file (OGG format) → The bot will transcribe and answer questions based on the audio content.

🔒 Security Best Practices

🚨 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.


🤝 Contributing

Contributions are welcome! 🛠 If you'd like to improve this bot, feel free to fork this repo, make changes, and submit a pull request.


📜 License

This project is licensed under the MIT License.


Support the Project

If you found this bot useful, consider starring 🌟 the repo to support development!

👉 GitHub Repo

🚀 Happy Coding!

About

a telegram bot which connects with the google gemini api

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages