• 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
Home Tips

Instructions to create your own ChatGPT Bot on Telegram

AnonyViet by AnonyViet
March 27, 2023
in Tips
0
0
SHARES
Share on FacebookShare on Twitter

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.

Instructions to create your own ChatGPT Bot on Telegram

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

How to install ChatGPT as an application on Windows 11
Tips

How to install ChatGPT as an application on Windows 11

November 30, 2023
How to put AI Copilot in the system tray on Windows 11
Tips

How to put AI Copilot in the system tray on Windows 11

November 29, 2023
test cache – AnonyViet
Tips

test cache – AnonyViet

November 29, 2023
Install Cubase 5 and Auto Tune to sing live like a singer
Tips

Install Cubase 5 and Auto Tune to sing live like a singer

November 29, 2023
How to register for free Office 365 for 5 devices for 1 year
Tips

How to register for free Office 365 for 5 devices for 1 year

November 27, 2023
Learn 4 ways to schedule computer shutdown in Windows 11
Tips

Learn 4 ways to schedule computer shutdown in Windows 11

November 26, 2023
Next Post
How to share files between Android/iOS and computer without software

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

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent News

How to install ChatGPT as an application on Windows 11

How to install ChatGPT as an application on Windows 11

November 30, 2023
How to put AI Copilot in the system tray on Windows 11

How to put AI Copilot in the system tray on Windows 11

November 29, 2023
Things to keep in mind when looking for office space for rent in District 2

Things to keep in mind when looking for office space for rent in District 2

November 29, 2023
What is Data Migration?  Learn about the best data migration tools today

What is Data Migration? Learn about the best data migration tools today

November 29, 2023
How to install ChatGPT as an application on Windows 11

How to install ChatGPT as an application on Windows 11

November 30, 2023
How to put AI Copilot in the system tray on Windows 11

How to put AI Copilot in the system tray on Windows 11

November 29, 2023
Things to keep in mind when looking for office space for rent in District 2

Things to keep in mind when looking for office space for rent in District 2

November 29, 2023
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

How to install ChatGPT as an application on Windows 11

How to install ChatGPT as an application on Windows 11

November 30, 2023
How to put AI Copilot in the system tray on Windows 11

How to put AI Copilot in the system tray on Windows 11

November 29, 2023
No Result
View All Result
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office

© 2023 JNews - Premium WordPress news & magazine theme by Jegtheme.