Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/davidmenger/botnaut

Chatbot Framework for Facebook Messenger platform
https://github.com/davidmenger/botnaut

chatbot chatbot-framework chatbots facebook-messenger-bot facebook-messenger-platform messenger-platform nodejs pragonauts

Last synced: 3 months ago
JSON representation

Chatbot Framework for Facebook Messenger platform

Awesome Lists containing this project

README

        

# Botnaut - DEPRECATED

Use [wingbot](http://github.com/wingbotai/wingbot) instead!

==============

[![CircleCI](https://circleci.com/gh/davidmenger/botnaut/tree/master.svg?style=svg)](https://circleci.com/gh/davidmenger/botnaut/tree/master)

Framework for building reusable chatbot components. **Routing**, **Keyword recognition** is built-in.

- [**[API documentation](http://davidmenger.github.io/botnaut)**]

## Requirements and installation

- requires `mongoose` > 4.0
- requires `nodejs` > 6.0
- requires `express` > 4.0
- requires `body-parser` > 1.10

```bash
$ npm i -S botnaut
```

## Basic setup with Express

It's easy. This basic example can handle everything.

```javascript
const express = require('express');
const { Router } = require('botnaut');
const mongoose = require('mongoose');
const { createRouter, createProcessor } = require('botnaut/express');

const bot = new Router();

bot.use('/hello', (req, res, postBack) => {
res.text('Hello world');
});

bot.use((req, res, postBack) => {
res.text('What you want?', {
hello: 'Say hello world'
});
});

const processor = createProcessor(bot, {
pageToken: 'pagetokenhere',
appSecret: 'botappsecret',
autoTyping: true
});

const app = express();

app.use('/bot', createRouter(processor, 'verifyTokenHere'));

mongoose.connect('mongodb://localhost/myapp')
.then(() => app.listen(3000));
```