Vott for Messenger (i.e. vott-messenger
) is a minimal, extensible framework for building Messenger bots.
- Fully extensible conversational flow (inbound/outbound middleware, event dispatcher middleware, and plugins)
- Serves multiple pages from a single instance
- Scoped questions for complex conversational trees
- Bring your own "hears" method *
- Custom persistence layer (i.e. datastore) *
- Thoroughly tested
* In order to keep vott
as unopinionated as possible, the framework makes no assumption on persistence layers or hears
methods. This reduces framework complexity and allows developers to have full control and understanding of the datastore.
$ npm install --save vott-messenger
const MessengerBot = require('vott-messenger')
/** instantiate MessengerBot */
const myBot = new MessengerBot({
access_token: process.env.FB_PAGE_ACCESS_TOKEN,
verify_token: process.env.FB_VERIFY_TOKEN
})
/** usage example: */
myBot.on('message_received', (bot, event) => {
bot.chat(event, (chat) => {
chat.say('Hello!')
chat.ask('How are you?', (res, chat) => {
chat.save({ user_status: res.text })
chat.say('Ok')
chat.next()
})
chat.next()
})
})
Documentation, guides, and API reference coming soon. :)
Something does not work as expected or perhaps you think this module needs a feature? Please open an issue using GitHub's issue tracker. Please be as specific and straightforward as possible.
Pull Requests (PRs) are welcome. Make sure you follow the same basic stylistic conventions as the original code. Your changes must be concise and focus on solving a single problem.
Clone the repo:
$ git clone git@github.com:krismuniz/vott-messenger.git
Install all dependencies and run tests:
$ npm install && npm test
Copyright (c) 2016 Kristian Muñiz