Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Messenger builder

Install and Run

Download this example or clone bottender.

curl | tar -xz --strip=2 bottender-master/examples/messenger-builder
cd messenger-builder

Install dependencies:

npm install

You must put accessToken, appSecret and verifyToken into bottender.config.js.

After that, you can run the bot with this npm script:

npm run dev

This command will start server for bot developing at http://localhost:5000.

Set webhook

While the server running, you can run following command with global bottender to set up the webhook:

bottender messenger webhook set -w <YOUR_WEBHOOK_URL>

If you want to expose the server on your local development machine and get a secure URL, ngrok or localtunnel may be good tools for you.

Note: You must put appId, appSecret and verifyToken into bottender.config.js before running this command.

Idea of this example

This example shows how to combine Handler with Messenger bot. For more information, check our Messenger guides.

Related examples