Skip to content

A template for creating an Ebony-based Facebook Messenger bot

License

Notifications You must be signed in to change notification settings

chrispanag/messenger-bot-template

Repository files navigation

Messenger Bot Template

A ready-to-go template to create your own Facebook Messenger bot using the Ebony Framework and the Ebony Messenger Adapter.

Getting Started

After you click on Use this template, you can clone the resulting repo and build your own bot.

Prerequisites

  1. You'll need a server with SSL setted up to host your bot. An easy and tested choice is Heroku. Alternatively, for local development, you can use Ngrok.
  2. You'll need a Messenger Platform Facebook app. You can learn how to set up your Messenger Platform Facebook app and the basics around it, at the official Facebook Developers Messenger Platform tutorial (up to step 4).

Set up

  1. Get the necessary environment variables (if you do local development you can either load them through the command line, or create a .env file and use dotenv to load it into the ./lib/secret.ts file). You'll need the following variables:

    a. FB_APP_SECRET:

    Access your app in developers.facebook.com

    Settings → Basic → App Secret.

    b. FB_PAGE_TOKEN:

    Access your app in developers.facebook.com

    Messenger → Settings → Page Access Token

    c. FB_PAGE_ID:

    Access your page in facebook.com

    About → Scroll Down – Page Id

    d. MONGODB_URI:

    Connection URI for your MongoDB database (if you use Heroku, it will be automatically setted up).

  2. If you use Heroku, just push your code to your Heroku app. In any other case, just hit npm install, npm run build, npm start.

Authors

License

This project is licensed under the MIT License - see the LICENSE file for details.

Releases

No releases published

Packages

No packages published