ChatGptBot: An AI-powered Telegram bot script for generating text-based responses using OpenAI
- 🍪 Text Prompt Response: Accepts text prompts and generates text.
Before you begin, ensure you have met the following requirements:
- Python 3.9 or higher.
pyrogram
,openai
libraries.- A Telegram bot token (you can get one from @BotFather on Telegram).
- API ID and Hash: You can get these by creating an application on my.telegram.org.
- To Get
GPT_API_KEY
Open GPT_API_KEY.
To install pyrogram
, openai
run the following command:
pip install pyrogram openai
Note: If you previously installed pyrofork
, uninstall it before installing pyrogram
.
- Open the
config.py
file in your favorite text editor. - Replace the placeholders for
API_ID
,API_HASH
,GPT_API_KEY
, andBOT_TOKEN
with your actual values:API_ID
: Your API ID from my.telegram.org.API_HASH
: Your API Hash from my.telegram.org.GPT_API_KEY
: To get Google API key Click Here.BOT_TOKEN
: The token you obtained from @BotFather.
git clone https://github.com/abirxdhack/ChatGptBot
cd ChatGptBot
python main.py
The bot supports the following commands:
/gpt <prompt>
: Generates a response based on a provided text prompt..gpt <prompt>
: Generates a response based on a provided text prompt./gpt4 <prompt>
: Generates a response based on a provided text prompt..gpt4 <prompt>
: Generates a response based on a provided text prompt.
- Name: Abir Arafat Chawdhury
- Telegram: @abirxdhackz