nsomar / plug_facebook_echo_bot

Elixir sample facebook messenger echo bot using Plug.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Plug facebook echo bot Deploy

Ex Echo Bot is an example of a facebook messenger bot that echos whats sent to it.

Usage

The easist way is using Heroku deploy button (from above).

Or manually, to start your plug app:

mix deps.get
PORT=8080 PAGE_TOKEN="FB_PAGE_TOKEN" VERIFY_TOKEN="FB_VERIFY_TOKEN" mix run --no-halt

Now you can visit localhost:8080 from your browser.

The webhook api endpoint is at: https://your_url/messenger/webhook

Configurations

When starting it in production, you need to set the following environment varibles

VERIFY_TOKEN the facebook verification token that will be sent in the facebook challenge. PAGE_TOKEN the facebook page token you will use with your app. PORT the port to start it on

To get the VERIFY_TOKEN and PAGE_TOKEN follow the instructions here

This project uses EXFacebookMessenger as a dependency to create the chat bot.

About

Elixir sample facebook messenger echo bot using Plug.


Languages

Language:Elixir 100.0%