chatgpt-telegram-bot
To use ChatGPT Telegram bot, please follow the instructions below.
- Obtain an OpenAI API key from https://platform.openai.com/account/api-keys
- Create a Telegram bot by using BotFather via https://t.me/BotFather
- Set OpenAI API key and Telegram Bot Token in the
docker-compose.yml
file. - In the
main.py
file, specify the Telegram admin user ID (you can send/ping
to your bot to obtain your user ID) and the prompt text. - If you want to use the bot in a group, you must disable privacy mode in the bot settings.
- Run
docker-compose up --build -d
- You can interact with your bot by initiating a new conversation with a message that starts with
$
. For example, you can type$Hello
. - To continue a conversation thread, reply to a previous message sent by the bot.
- You can reply multiple times to the same message to "fork" the thread.
- In a group, only the bot admin can use the
/add_whitelist
command to whitelist the group. To remove the group from the whitelist, the admin can use the/del_whitelist
command. - Finally, in a private chat with the bot, you can use the
/get_whitelist
command to get a list of all whitelisted groups.
By following these steps, you can effectively use the ChatGPT Telegram bot for your needs.
Note: the above instructions are written by ChatGPT.