This repository contains a Python Telegram chatbot integrated with the Gemini conversational AI model from Google. With this bot, you can have engaging conversations with users on Telegram using advanced AI capabilities.
-
Install the required Python packages:
-
telebot: A library for interacting with the Telegram Bot API.
pip install telebot
-
google-generativeai: A Python client library for accessing Google's generative AI models, including Gemini.
pip install google-generativeai
-
python-dotenv: A library for managing environment variables from a .env file.
pip install python-dotenv
-
-
Clone this repository to your local machine:
git clone https://github.com/LaXnZ/python-gemini-telegram-chatbot.git
-
Navigate to the project directory:
cd python-gemini-telegram-chatbot
-
Create a
.env
file in the project directory and add your Telegram bot token and Gemini API key:TELEGRAM_TOKEN=your_telegram_token_here GENAI_API_KEY=your_genai_api_key_here
-
Run the bot script using Python:
python main.py
-
Start a conversation with your bot on Telegram and enjoy interactive conversations with the Gemini AI model.
Contributions to this project are welcome! If you have any ideas for improvements or new features, feel free to fork the repository, make your changes, and submit a pull request.
Replace your_telegram_token_here
and your_genai_api_key_here
in the .env
file with your actual Telegram bot token and Gemini API key. Customize the instructions and placeholders as needed for your specific project.