Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
src
tests
.babelrc
.eslintrc
CHANGELOG.md
LICENSE.md
PRODUCTS.json
README.md
intents.xlsx
messenger-config.js
package.json
test-config.js

README.md

test-ecommerce

This bot tests how you can implement a bot on Facebook Messenger with structured message like carousel.

Create an app

Create an app and add intents/QnAs on Botfuel Trainer (https://app.botfuel.io).

You can get examples of intents here : https://github.com/Botfuel/botfuel-dialog/blob/master/packages/test-ecommerce/intents.xlsx

See the Getting Started tutorial for how to create a new app.

Run the bot

Before running your bot, there are a few steps to connect it to Facebook Messenger:

  • Create a page on Facebook.
  • Get your page access token and note it ( FB_PAGE_ACCESS_TOKEN ).
  • Subscribe your app to the page you just created.
  • Define a verify token of your choice ( FB_VERIFY_TOKEN, ex: 'MyBotToken2017' ).
  • Set up a webhook to allow your application to talk with Messenger (you need to have a running bot for this step).

Then run the bot with the following environment variables:

FB_VERIFY_TOKEN=<...> FB_PAGE_ACCESS_TOKEN=<...> BOTFUEL_APP_TOKEN=<...> BOTFUEL_APP_ID=<...> BOTFUEL_APP_KEY=<...> yarn start messenger-config

Run the tests

BOTFUEL_APP_TOKEN=<...> BOTFUEL_APP_ID=<...> BOTFUEL_APP_KEY=<...> yarn test

Clean the brain

To empty the brain of your bot:

BOTFUEL_APP_TOKEN=<...> yarn run clean

Need help ?

  • See Getting Started to learn how to run a bot in minutes.
  • See Concepts for explanations about the internals of the SDK.

License

See the License file.