A Facebook messenger bot that gives train information from Romanian Railways. A live version of the app can be accessed here (not yet available)
Please feel free to contribute to anything for example:
- documentation
- code
- issues
- templates
- fixing bugs
- suggestions
-
Clone the project
git clone https://github.com/alexmarginean16/Travelrr.git cd Travelrr/
-
Create a python virtual environment
python3 -m venv venv
-
Activate venv:
. /venv/bin/Activate
-
Install requirements
pip install -r requirements.py
-
Create a facebook page here.
-
Access facebook developers and create a new app, add the messenger product.
-
Go to Messenger > Settings, select your page and get your
Page Access Token
. -
Run your python application:
export FB_PAGE_TOKEN='<<yourpagetoken>>' export FB_VERIFY_TOKEN='<<yourverifytoken>>' python app.py.
Where FB_PAGE_TOKEN
is the access token you copied from facebook app, and FB_VERIFY_TOKEN
could be whatever you want.
- Run ngrok on the same port as the python server (usually 5000)
./ngrok http 5000
. - On facebook developer website while in your app go to Messenger > Settings and click
Add webhook
. At the webhook URL paste the link ngrok created for thelocalhost
tunnel, and theFB_VERIFY_TOKEN
value you created before. Select every checkbox and click done. - Down to "Select a page to subscribe your webhook to the page events" select your desired page and click "subscribe".
Done! 🎉