fbbot is a simple Django app to showcasing the Messenger Platform, make your facebook bot with Django
Project description
fbbot is a simple Django app to showcasing the Messenger Platform, make your facebook bot with django
Quick start
Note. If yo don’t have a https server and domain. For development purposes I use NGROK, a good “Secure tunnels to localhost” service ( url:https://ngrok.com/ ):
> Download ngrok binary https://ngrok.com/download > execute ./ngrok http 8000 > Copy url like '12345678.ngrok.io'
Clone this repo and install the requeriments:
git clone https://github.com/espacioAntonio/Django-messenger-platform-bot.git cd Django-messenger-platform-bot pip install -r requirements.txt
Add your valid settings in ./fbbot/settings.py:
FB_PAGE_TOKEN = "FACEBOOK_PAGE_TOKEN" FB_VERIFY_TOKEN = "VERIFY_TOKEN_DEFINED_BY_DEVELOPER" REAL_URL = "URL_PROVIDED_BY_NGROK" #example: 12346578.ngrok.io or www.yourdomain.com
Run:
python manage.py runserver 8000
Suscribe your new webhook in your Facebook App:
WEBHOOK URL Callback: https://YOUR_REAL_URL/fbbot/webhook Verify Token: "VERIFY_TOKEN_DEFINED_BY_DEVELOPER"
Visit http://127.0.0.1:8000/fbbot/webhook and see “Hello World, webhook enable” message.
Send a message to your facebook page or send this messages:
image gif audio file button generic receipt quick reply read receipt typing on typing off account linking
Integrate this app with your Django App
Install the django-fbbot package with python-pip:
pip install django-fbbot
Add your valid tokens in your settings file mysite/settings.py:
FB_PAGE_TOKEN = "FACEBOOK_PAGE_TOKEN" FB_VERIFY_TOKEN = "VERIFY_TOKEN_DEFINED_BY_DEVELOPER" REAL_URL = "URL_PROVIDED_FOR_NGROK" #example: 12346578.ngrok.io or www.yourdomain.com BASE_URL = "https://"+REAL_URL
Add “fbbot” to your INSTALLED_APPS setting like this:
INSTALLED_APPS = [ ... 'fbbot', ]Include the fbbot URLconf in your project urls.py like this:
url(r'^fbbot/', include('fbbot.urls')),Run python manage.py collectstatic to collect files to test.
Start the development server and visit http://127.0.0.1:8000/fbbot/webhook
Visit http://127.0.0.1:8000/fbbot/webhook and see “Hello World, webhook enable”
Send a message to your facebook page or send this messages:
image gif audio file button generic receipt quick reply read receipt typing on typing off account linking
Uninstall
If you want to uninstall this package run:
pip uninstall django-fbbot
Remove “fbbot” in your INSTALLED_APPS setting:
INSTALLED_APPS = [ ... 'fbbot', ]Remove the fbbot URLconf in your project urls.py:
url(r'^fbbot/', include('fbbot.urls')),
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file django-fbbot-0.1.tar.gz.
File metadata
- Download URL: django-fbbot-0.1.tar.gz
- Upload date:
- Size: 3.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc11ca4b8ce3456adf4ee4af0f640876638403c5cba32f2a5c2bfcc327ac66e4
|
|
| MD5 |
608fa66991120eae1ebe692ba8362cae
|
|
| BLAKE2b-256 |
948bb9ec0d5e53edd451b5c4bdbc589c55409b3b31d79ed0a182df9a7c5fc6bb
|