• Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office
AnonyViet - English Version
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office
No Result
View All Result
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office
No Result
View All Result
AnonyViet - English Version
No Result
View All Result

Instructions to create your own ChatGPT Bot on Telegram

AnonyViet by AnonyViet
March 27, 2023
in Tips
0

ChatGPT provides free API and 18$ token for you to create Bot on Telegram. In this article, I will guide you to create a ChatGPT Bot on Telegram for free for you to chat or add to your Telegram group.

Join the channel Telegram belong to AnonyViet ???? Link ????

I find this topic hot forever. ChatGPT The more developed the software, the more afraid of software brothers, but that is for those who do not know how to exploit the power of ChatGPT. To take full advantage of ChatGPT, you must include it in your daily activities. One of the activities you do most often is to exchange messages on online application platforms such as messenger and telegram. Messenger, I have not heard of anyone integrating ChatGPT, but telegram does. So in this article, I will guide you to create a telgeram bot using ChatGPT extremely easily.

How to create a telegram bot using ChatGPT

ChatGPT telegram bot feature

  • Support markdown in the answer

  • Reset the conversation using the /reset . command

  • Shows typing message while waiting for bot response

  • Access can be restricted by specifying a list of users

  • Docker and Proxy Support

  • Create an image using DALL·E via the /image . command

  • Transcribe audio and video messages using Whisper (may require ffmpeg)

  • Automatically summarize responses to avoid excessive API usage

  • Track API usage per user

  • Statistics for each individual’s API usage and cost per day/month via /stats . command

  • Stream Support

Request

To create ChatGPT Bot on Telegram, you should install it on Ubuntu or Kali Linux for better support.

  • Python 3.9+
  • Token bot Telegram. You can use BotFather here: Type command /newbot, then enter a name for the Bot you want to create. Note, the Bot name must end with _BOT, for example: ANVGPT_BOTafter creating you will see the botfather provides HTTP API, remember to save this token.
    Instructions to create your own ChatGPT Bot on Telegram 10
  • OpenAI API. Register for an OpenAI ChatGPT account (instruct). Then copy the API Key at this page.

How to install

Step 1: Clone repo from github and access project folder from cmd.

git clone https://github.com/n3d1117/chatgpt-telegram-bot.git
cd chatgpt-telegram-bot

Step 2: Create a virtual environment for python.

python -m venv venv

Step 3: Enable the virtual environment.

venv\Scripts\activate

Step 4: Install other libraries in file requirements.txt:

pip3 install -r requirements.txt

Step 5: Replace OpenAI API and bot father in file .env.example. Then rename this file to .env.

Instructions to create your own ChatGPT Bot on Telegram 11

In case you want to add bots to the telegram group, you can change the parameters ADMIN_USER_IDS and ALLOWED_TELEGRAM_USER_IDS.

  • ADMIN_USER_IDS: Telegram ID of admin admin. These users have access to special commands, information, and no budget restrictions. You do not need to add an administrator ID to ALLOWED_TELEGRAM_USER_IDS. Note: by default the bot will have no admin (‘-‘).
  • ALLOWED_TELEGRAM_USER_IDS: List of Telegram user IDs, allowed to interact with bots (you can use getidsbot to find your user IDs). In order for everyone to be able to chat with the bot, enter the *.

Step 6: Run the bot with the command below.

python bot/main.py

So that’s it then. Now you go to Telegram, find the bot you just created with Botfather and chat with it, it will get results from ChatGPT to reply to you.

In addition, the Bot supports the following commands:

  • /image: create images from cue words
  • /stats: statistics of tokens used by ChatGPT API
  • /reset: delete the requested information stored on ChatGPT
  • /help: show support panel

Advanced: Re-optimizing ChatGPT Bot on Telegram

In case you create a ChatGPT Bot into a telegram group, there is a point to note that normal messages will all be responded to by the bot. So it will be easy to encounter spam cases if your group is large. You can modify the following lines of code so that when the user uses the ask command, the bot will respond.

Step 1: First, you find the prompt function and rename this function to ask. Just change the prompt to ask.

Instructions to create your own ChatGPT Bot on Telegram 12

Step 2: In the newly renamed ask function, change the command line in the image to the command below:

prompt = update.message.text.replace('/ask', '').strip()

Instructions to create your own ChatGPT Bot on Telegram 13

Step 3: Replace the handler function call with the following function:

application.add_handler(CommandHandler('ask', self.ask))

Instructions to create your own ChatGPT Bot on Telegram 14

So you have created your own ChatGPT Bot on Telegram, you can use it alone to add to the group so that it becomes your assistant by answering yourself with the results of AI GPT.

Rate this post

Tags: BotChatGPTcreateInstructionsTelegram
Previous Post

How to use ChatGPT-4 for free on Chrome and FireFox

Next Post

How to share files between Android/iOS and computer without software

AnonyViet

AnonyViet

Related Posts

27 interesting tricks on CMD you may not know
Tips

27 interesting tricks on CMD you may not know

June 24, 2025
iMyfone anyrecover: Restore data deleted on Windows 100%
Tips

iMyfone anyrecover: Restore data deleted on Windows 100%

June 23, 2025
Learn how VPN protects you from hackers
Tips

Learn how VPN protects you from hackers

June 22, 2025
Download Ebook Ethical Hacking & Penetration Testing Guide
Tips

Download Ebook Ethical Hacking & Penetration Testing Guide

June 21, 2025
List of the best temporary virtual mail creation websites
Tips

List of the best temporary virtual mail creation websites

June 20, 2025
How to get email (gmail) a series from Facebook comments
Tips

How to get email (gmail) a series from Facebook comments

June 19, 2025
Next Post
How to share files between Android/iOS and computer without software

How to share files between Android/iOS and computer without software

0 0 votes
Article Rating
Subscribe
Login
Notify of
guest

guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments

Recent News

27 interesting tricks on CMD you may not know

27 interesting tricks on CMD you may not know

June 24, 2025
Ktimer: scheduled to turn off the phone, hibernate easily for busy people

Ktimer: scheduled to turn off the phone, hibernate easily for busy people

June 24, 2025
iMyfone anyrecover: Restore data deleted on Windows 100%

iMyfone anyrecover: Restore data deleted on Windows 100%

June 23, 2025
Things to know when buying Galaxy Ring

Things to know when buying Galaxy Ring

June 23, 2025
27 interesting tricks on CMD you may not know

27 interesting tricks on CMD you may not know

June 24, 2025
Ktimer: scheduled to turn off the phone, hibernate easily for busy people

Ktimer: scheduled to turn off the phone, hibernate easily for busy people

June 24, 2025
iMyfone anyrecover: Restore data deleted on Windows 100%

iMyfone anyrecover: Restore data deleted on Windows 100%

June 23, 2025
AnonyViet - English Version

AnonyViet

AnonyViet is a website share knowledge that you have never learned in school!

We are ready to welcome your comments, as well as your articles sent to AnonyViet.

Follow Us

Contact:

Email: anonyviet.com[@]gmail.com

Main Website: https://anonyviet.com

Recent News

27 interesting tricks on CMD you may not know

27 interesting tricks on CMD you may not know

June 24, 2025
Ktimer: scheduled to turn off the phone, hibernate easily for busy people

Ktimer: scheduled to turn off the phone, hibernate easily for busy people

June 24, 2025
  • Home
  • Home 2
  • Home 3
  • Home 4
  • Home 5
  • Home 6
  • Next Dest Page
  • Sample Page

©2024 AnonyVietFor Knowledge kqxs hôm nay xem phim miễn phí SHBET 23win https://kubet88.yoga/ KUBET BK8 Bj88 https://u888b.site/

No Result
View All Result
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office

©2024 AnonyVietFor Knowledge kqxs hôm nay xem phim miễn phí SHBET 23win https://kubet88.yoga/ KUBET BK8 Bj88 https://u888b.site/

wpDiscuz
0
0
Would love your thoughts, please comment.x
()
x
| Reply