Skip to content
This repository has been archived by the owner on Mar 18, 2020. It is now read-only.

krismuniz/vott-messenger

Repository files navigation

Vott for Messenger

npm License:MIT Build Status Coverage Status Dependency Status Known Vulnerabilities

Vott for Messenger (i.e. vott-messenger) is a minimal, extensible framework for building Messenger bots.

Features

  • Fully extensible conversational flow (middleware and plugins)
  • Serves multiple pages from a single instance
  • Scoped questions for complex conversational trees
  • Thoroughly tested and secure

Simplicity First

In order to keep vott as simple as possible, vott makes no assumption on state-management, persistence layers, or message-processing functionality. Extra functionality must be provided by developers and third-party plugins or middleware.

Installation

$ npm install --save vott-messenger

Quick Example

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,
  endpoint: '/facebook/receive'
})

/** 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()
  })
})

myBot.setupServer(process.env.PORT, (err, server) => {
  if (err) throw Error(err)
  console.log(`Server listening on port ${process.env.PORT}`)
}).setupWebhooks()

Documentation

Guides

Reference

Contributing

Dev Dependency Status Code-Style:Standard

Bug Reports & Feature Requests

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.

Developing

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.

Build Instructions for Contributors

Clone the repo:

$ git clone git@github.com:krismuniz/vott-messenger.git

Install all dependencies and run tests:

$ npm install && npm test

License

The MIT License (MIT)

Copyright (c) 2017 Kristian Muñiz

About

A minimal, extensible framework for building Messenger bots.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published