This is a Telegram bot that uses the OpenAI's GPT-3 model to answer questions and generate responses. The bot is written in Python and uses the Telethon library to interact with the Telegram API, and the OpenAI API to communicate with the GPT-3 model. It also uses the Telegraph API to create a Telegraph article of the response and sends the link to the user as a reply.
To use the bot, send your questions along with the /ask command. For example, if you want to ask "What is the weather today?", you should send the message "/ask What is the weather today?"
To run the bot, you need to have the following things:
- A Telegram account and a bot token
- An OpenAI API key (if you have more than one key the bot will select next key in case of usage exceed error)
- A Telegraph API token
- Python 3.8 or higher
Once you have these things, you can clone the repository and install the dependencies by running the following command:
git clone https://github.com/hybridvamp/chatgptbot.git
cd chatgptbot
pip3 install -r requirements.txt
Then, you need to set the following environment variables:
- API_ID
- API_HASH
- BOT_TOKEN
- API_KEY1
- API_KEY2 (optional)
- API_KEY3 (optional)
- API_KEY4 (optional)
- API_KEY5 (optional)
- TELEGRAPH_TOKEN (get telegraph token usibg the following link https://api.telegra.ph/createAccount?short_name=anyname&author_name=anyname)
Finally, you can run the bot by running the following command:
python3 main.py
Contributions and Pull Requests are most welcome. If you have any suggestions or improvements, please feel free to open an issue or submit a pull request.
For any queries and support, you can contact me on Telegram at @hybrid_chat