Create Your Own Telegram Bot Powered by GPT-4 for Free

2 min


In recent weeks, there has been significant buzz surrounding GPT-4, largely due to a library that offers free access to GPT-3.5 without requiring tokens. However, it’s essential to clarify that this library represents an enhanced version of GPT-3.5, not GPT-4 itself. Utilizing the genuine GPT-4 without incurring costs remains an unattained feat.

Interestingly, Bing stands out as the closest counterpart to GPT-4 in terms of capabilities, and it comes at no expense, complete with internet access. Today, I’ll guide you through the process of integrating Bing into Telegram, enabling you to harness nearly all the functionalities offered by the Bing website.

1. Begin by Creating a Telegram Bot

  • Initiate the creation of a Telegram bot through BotFather.
  • Type /start and then /newbot.
  • Specify the name for your bot.
  • Assign a username to the bot, preferably one that ends with “bot” or “_bot.”
  • You will receive the bot’s API Token, which will be required later.

2. Obtain Bing’s Cookies for the Script to Operate

  • Register on bing.com.
  • Access the Microsoft Edge browser.
  • Install any extension capable of exporting cookies. For instance, I used Cookie Editor.
  • Activate a VPN and navigate to https://bing.com/chat.
  • Enable the extension and select “Export.”

Once you’ve acquired the cookies, create a folder where you’ll establish the following files:

  1. cookie.json (The .json extension is mandatory!)
  2. main.py

Open the “cookie.json” file with a text editor and paste the copied cookies there. Now, proceed to the “main.py” file and insert the following code.

3. Executing the Script

Replace “token” with your BotFather-provided token in the line TOKEN = “token.”

Next, open the console (win + r, type cmd, and press Enter), and paste the following text:

pip install aiohttp==3.8.4 && EdgeGPT==0.2.1 && pyTelegramBotAPI==4.10.0 && telebot~=0.0.5 && asyncio~=3.4.3

After installing the libraries, run the script!

4. Guidelines for Running the Script on Windows

For running the script, Python is essential. Ensure you have Python version 3.10.6 installed.

Open the console and execute the following command:

pip install EdgeGPT==0.1.13.1 && pip install pyTelegramBotAPI && pip install aiohttp

Upon installing the libraries, initiate the script by double-clicking on the .py file. Revel in your success!


Like it? Share with your friends!

0 Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Send this to a friend
Hi, this may be interesting you: Create Your Own Telegram Bot Powered by GPT-4 for Free! This is the link: https://allboutgpt.com/2023/09/04/create-your-own-telegram-bot-powered-by-gpt-4-for-free/