Skip to main content

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'
  1. 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
  2. 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
  3. Run:

    python manage.py runserver 8000
  4. Suscribe your new webhook in your Facebook App:

    WEBHOOK
    URL Callback: https://YOUR_REAL_URL/fbbot/webhook
    Verify Token: "VERIFY_TOKEN_DEFINED_BY_DEVELOPER"
  5. Visit http://127.0.0.1:8000/fbbot/webhook and see “Hello World, webhook enable” message.

  6. 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

  1. Install the django-fbbot package with python-pip:

    pip install django-fbbot
  2. 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
  3. Add “fbbot” to your INSTALLED_APPS setting like this:

    INSTALLED_APPS = [
        ...
        'fbbot',
    ]
  4. Include the fbbot URLconf in your project urls.py like this:

    url(r'^fbbot/', include('fbbot.urls')),
  5. Run python manage.py collectstatic to collect files to test.

  6. Start the development server and visit http://127.0.0.1:8000/fbbot/webhook

  7. Visit http://127.0.0.1:8000/fbbot/webhook and see “Hello World, webhook enable”

  8. 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

  1. If you want to uninstall this package run:

    pip uninstall django-fbbot
  2. Remove “fbbot” in your INSTALLED_APPS setting:

    INSTALLED_APPS = [
        ...
        'fbbot',
    ]
  3. Remove the fbbot URLconf in your project urls.py:

    url(r'^fbbot/', include('fbbot.urls')),

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-fbbot-0.1.tar.gz (3.7 MB view details)

Uploaded Source

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

Hashes for django-fbbot-0.1.tar.gz
Algorithm Hash digest
SHA256 bc11ca4b8ce3456adf4ee4af0f640876638403c5cba32f2a5c2bfcc327ac66e4
MD5 608fa66991120eae1ebe692ba8362cae
BLAKE2b-256 948bb9ec0d5e53edd451b5c4bdbc589c55409b3b31d79ed0a182df9a7c5fc6bb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page