A Telegram bot powered by Google Gemini AI (Generative AI) that answers questions and chats with users. Works in both private chats and groups (when tagged). Like ChatGPT, but for Telegram!
- AI-powered responses using Google Gemini
- Works in private chats and groups (responds when tagged)
- Simple setup and deployment
- Python 3.11.8
- Telegram Bot Token
- Google Gemini API Key
-
Clone the repository:
git clone <repo-url> cd hacker-telegram-bot
-
Install dependencies:
pip install -r requirements.txt
-
Set up environment variables: Create a
.envfile in the project root with the following content:BOT_TOKEN=your-telegram-bot-token GEMINI_API_KEY=your-gemini-api-key
- Start the bot locally:
python bot.py
- In a group: Tag the bot (e.g.,
@gembotai_bot) to get a reply. - In private chat: Just send your message.
/start— Introduction message/help— Usage instructions
- Heroku (or similar):
- The included
Procfileandruntime.txtare ready for deployment. - Set the required environment variables (
BOT_TOKEN,GEMINI_API_KEY) in your hosting dashboard. - The bot will start with
python bot.py.
- The included
A simple test script is included:
python gemini_test.pypython-telegram-botgoogle-generativeaipython-dotenv
MIT (add your license if different)
Made with ❤️ using Google Gemini and python-telegram-bot.
