Telegram Chatbot with OpenAI ChatGPT This Telegram chatbot uses OpenAI's ChatGPT to provide natural language responses to user inputs. The bot is built with Python, and uses the Telegram Bot API to communicate with users. User IDs are stored in a MongoDB database for personalized interactions.
Python 3.x python-telegram-bot library OpenAI API key MongoDB
- Clone this repository to your local machine.
- Install the required libraries using pip:
- pip install -r requirements.txt
- Set the environment variables:
- TELEGRAM_TOKEN: Your Telegram bot token
- OPENAI_API_KEY: Your OpenAI API key
- MONGODB_URI: Your MongoDB URI
python main.py
To use the bot, simply start a chat with it on Telegram. The bot will respond to user inputs with natural language responses generated by OpenAI's ChatGPT. The bot will also save the user ID in the MongoDB database for personalized interactions.
Contributing If you would like to contribute to this project, please open a pull request or submit an issue. All contributions are welcome!
License This project is licensed under the MIT License - see the LICENSE file for details.