An automated Telegram bot that reads chat messages from the screen and replies using Google Gemini AI. The bot simulates a real human conversation style and automatically responds to new messages.
• Automatic Telegram message detection • AI replies using Gemini Flash model • Human-like Hinglish conversations • Prevents duplicate replies • Fully customizable screen coordinates • Works with Telegram Desktop
- Bot selects Telegram chat messages
- Copies chat history
- Sends it to Gemini AI
- Generates reply
- Pastes and sends reply automatically
Clone the repository
git clone https://github.com/sujal872/telegram-ai-bot.git
cd telegram-ai-bot
Install dependencies
pip install -r requirements.txt
Create .env file
GEMINI_API_KEY=YOUR_API_KEY
Run the coordinate finder script:
python get_coordinates.py
Move your mouse to important Telegram UI elements:
• Chat window • Message selection area • Input box • Send button
Update these values in bot.py.
This image shows the screen coordinates used by the automation script to select messages and send replies.
python bot.py
Bot will start in 5 seconds.
Make sure Telegram Desktop is open.
• Works best with Telegram Desktop • Screen resolution affects coordinates • Keep Telegram window in the same position
Python PyAutoGUI Pyperclip Google Gemini AI
This project is for educational purposes only. Use responsibly and respect platform policies.
Sujal Karnwal Cybersecurity Enthusiast | Python Learner
If you like this project, consider giving it a ⭐ on GitHub.

