Thiru-Malai / ChatGPT-WhatsappBot-Twilio

ChatGPT Whatsapp Bot With Twilio

Home Page:https://www.buymeacoffee.com/thirumalaikg

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not working Locally

ayush20501 opened this issue · comments

i am running the free-trail main.py locally but it's showing not found error!

Can you send screenshots of the error?
It will be helpful for fixing.

Also let me know what have you done so that I can reproduce the error

To run your app in local you need to follow these steps:

mkdir chatgpt
cd chatgpt
python3 -m venv

For Linux un: source venv/bin/activate
For Windows run: venv/Scripts/activate

pip install twilio flask requests

Create a main.py in root directory

The hierarchy should be like this:

image

Copy the code from Free-Trial (Code Updated) into main.py

NGROK Local Deployment:

Now download ngrok

  1. https://ngrok.com/download
  2. Extract the zip and add the folder to the environment variables
  3. Login to ngrok website: https://dashboard.ngrok.com/get-started/setup
  4. run ngrok config add-authtoken in terminal

Ngork

  1. run ngrok http 5000
    The output should be like

image

  1. Copy the Forwarding URL from the terminal and paste it in Twilio console and WhatsApp sandbox settings:
    Paste the URL appended with /bot
    Original Url: https://2262-49-204-133-70.ngrok-free.app/
    Appended Url:https://2262-49-204-133-70.ngrok-free.app/bot

image

Now run the main.py and send message in your WhatsApp

It should work fine

I already do the step above, but in ngrok it returned a 403 Forbidden when I send message in whatsApp, can you help?

Make sure you have Paid OPEN-API Key. Free open-api key does not work.

Also append /bot similar to this https://2262-49-204-133-70.ngrok-free.app/bot but replace with your url that is generated from ngrok.

Please let me know if this works and make sure to follow all the steps without missing anything.