rapirent / facebook-simple-bot

simple echo fb bot for demo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Facebook-simple-bot

requirements

  • python3.6
  • ngrok

how to set up

install packages

  • in your python virtualenv
$ python install -r requirements.txt

generate random verify token

  • in your python interactive interpretor
import secrets
secrets.token_hex(nbytes=16)
  • crate a json file name .config.json, and follow up the format below (you should fill up the value)
{
    "VERIFY_TOKEN": "",
    "PAGE_TOKEN": ""
}

webhook with facebook

  • run this application, default setting is binding the port 8000
$ python app.py --debug
  • use ngrok to get SSL, here set to bind the port 8000
$ ./ngrok http 8000
  • enter the verify token and SSL URL
    • note that 回呼網址 should enter the webhook router https://ngrok.***.io/webhook
  • can check facebook doc

Subscribe your facebook page

  • select your facebook page and generate page token

LICENSE

MIT @ Kuoteng, 2018

About

simple echo fb bot for demo


Languages

Language:Python 100.0%