Do you want to access ChatGPT directly from Telegram, save the conversation, or forward the conversation to a friend or colleague? Are you constantly switching between your messaging app and your web browser to get answers to your questions? No longer do you have to. Create a ChatGPT Telegram bot and use ChatGPT in Telegram.
We can easily integrate ChatGPT with Telegram by creating a Telegram bot that’s essentially ChatGPT but as a bot in Telegram. Once we’ve connected ChatGPT to Telegram, we can get access to all the features of ChatGPT, such as composing emails, writing and debugging code, providing helpful information, and much more. Additionally, we can use voice to chat with ChatGPT.
With ChatGPT in Telegram, we can get instant answers to all our questions without ever leaving the app. So, without further delay, let’s learn how to integrate ChatGPT with Telegram and how to use ChatGPT in Telegram.
Accessing ChatGPT from Telegram
This tutorial covers how to integrate ChatGPT with Telegram and use ChatGPT in Telegram. To get your hands on it and get a taste of it, you can try a ChatGPT Telegram bot that has already been created.
Click on the ChatGPT Telegram bot link to chat with ChatGPT from Telegram: @chatgpt_karfly_bot
On connecting to the ChatGPT Telegram bot, you’ll be shown a few commands and the chat mode–the mode to use ChatGPT in Telegram for. Select the suitable option according to what you want to do with the ChatGPT Telegram bot.
You can also use this ChatGPT Telegram bot to access ChatGPT from Telegram which gives you more free tokens. It has practically the same functionality but is fluent in more languages: @LunaGPTBot
You can only have a limited number of free conversations with the bot. To increase the quota, you need to buy more tokens from the bot creator. So let us create our own bot with our own tokens.
If you want to create your own bot to integrate ChatGPT with Telegram using your OpenAI API key, follow the tutorial below.
Requirements to integrate ChatGPT with Telegram
There are a few ways to integrate ChatGPT with Telegram. For this tutorial, we’ll be using a repository from GitHub to integrate ChatGPT with Telegram.
Here are a few things that you’ll need to have on your computer:
- Python (and a few Python packages, which need not be installed separately)
And the following to create a Telegram bot and connect ChatGPT to Telegram:
- The ChatGPT Telegram bot GitHub repository
- OpenAI API key
- Telegram bot token
Steps to integrate ChatGPT with Telegram
- Go to the ChatGPT Telegram bot GitHub repository and download the repository. Click here to clone it. Then unzip the file.
- Get the OpenAI API key.
- Obtain an API key from OpenAI. The API key can be found in the User Settings.
- If you don’t have the secret key saved, you can create a new one by clicking the “+ Create new secret key” button. Keep the key safe and confidential; the key will not be displayed again.
- Create your Telegram bot token using @BotFather. More information on how to obtain a Telegram bot token.
Setting up the ChatGPT and Telegram integration
1. Open the config folder and edit the
config.example.yml. Enter the Telegram bot token and the ChatGPT API key.
You can also specify the users to whom to make the bot available. Then save and close the file.
2. Rename the
config.example.yml file to
3. Open Terminal or Command Prompt and navigate to the Telegram bot directory and run the following command. (You can also open the
chat_gpt_telegram_bot-main folder and open Terminal or Command Prompt from there.)
docker-compose --env-file config/config.env up --build
On running the above command, the required packages will be installed and a Docker container image will be created that hosts the ChatGPT Telegram bot.
If all goes right, you’ll be to use ChatGPT from Telegram. Simply message the bot using the bot username you’ve given and chat with it. It will respond as ChatGPT does but in Telegram.
You can configure and modify existing chat modes or add different chat modes with your own prompt by editing the chat_modes.yml file in the config folder.
If for some reason, you are not able to successfully integrate ChatGPT with Telegram (as there are several ways things may fail to work), you can also try this ChatGPT Telegram bot.
Some recommended articles