Home ยป Azure OpenAI integrate with Telegram Bot

Azure OpenAI integrate with Telegram Bot

0 comment 147 views

Follow below steps.

Base on n3d1117’s chatgpt-telegram-bot
https://github.com/n3d1117/chatgpt-telegram-bot

  1. Build a Ubuntu LXC (Hard disk = 1GB)
  2. Allow Root SSH
  3. apt update && apt upgrade -y
  4. Download the code
    wget https://github.com/V-know/ChatGPT-Telegram-Bot/archive/refs/heads/main.zip
  5. Install Unzip and unzip the code
    apt install unzip
    unzip main.zip
  6. Copy .env.example to .env, then edit the own keys and id
    cd ChatGPT-Telegram-Bot-main
  7. Install pip
    apt install python3-pip
  8. Install required modules
    pip install -r requirements.txt –break-system-packages
  9. Since this code is for original OpenAI ChatGPT, this is not work for Azure OpenAI. Therefore this is required to make change on bot/openai_helper.py
  10. Execute the code
    python3 bot/main.py
  11. Test it.
  12. If everything go smooth, then stop the code. And then, set the cron job to let the code start everything boot up the system.
    crontab -e
    Then add
    $ @reboot sleep 60; sudo python3 bot/main.py &

Done.

Optional:

Install ffmpeg to support voice message.

apt install ffmpeg

Refer:
https://github.com/n3d1117/chatgpt-telegram-bot

Leave a Comment