Skip to main content

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')),

Release files for django-fbbot 0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-fbbot 0.1
File Size Uploaded
django-fbbot-0.1.tar.gz 3.7 MB Details

Release files / django-fbbot-0.1.tar.gz

Download URL django-fbbot-0.1.tar.gz
Size 3.7 MB
Tags Source
SHA-256 checksum
How to use checksums
bc11ca4b8ce3456adf4ee4af0f640876638403c5cba32f2a5c2bfcc327ac66e4
BLAKE2b-256 checksum
How to use checksums
948bb9ec0d5e53edd451b5c4bdbc589c55409b3b31d79ed0a182df9a7c5fc6bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page