Install Flask & requests packages using Python's dependency package manager(pip);
pip install Flask requestsDownload and Install ngrok from the Official Ngrok Website.
Run the dev server using:
python server.pyUse ngrok to tunnel the connection;
./ngrok http 5000You will see the url for your local server. Something like: https://6cecffb8.ngrok.io.
-
Create a Facebook App from Facebook Developer Website.

-
Set Up the
MessengerProduct (you should have a Facebook Page link your bot with).
-
Select a page and enable webhooks. Use the above URL as the callback webhook URL (it should be
https).
-
Edit
server.pyand update theVERIFY_TOKEN(you set, in this case "secret") &ACCESS_TOKEN(randomly generated token). -
Once the callback is verified, subscribe the app to one of your pages to activate the bot.

-
Edit
server.pyand update theACCESS_TOKENwith the new token we got.
Visit your Facebook Page to chat with the bot. Make sure to follow all the steps above in order for the bot to be activated on your Facebook Page. 👍
