Socket
Book a DemoInstallSign in
Socket

botnaut

Package Overview
Dependencies
Maintainers
2
Versions
85
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

botnaut

Facebook Messenger Chatbot Framework

latest
Source
npmnpm
Version
0.31.0-alpha.4
Version published
Maintainers
2
Created
Source

Botnaut - DEPRECATED

Use wingbot instead!

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

CircleCI

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

  • [API documentation]

Requirements and installation

  • requires mongoose > 4.0
  • requires nodejs > 6.0
  • requires express > 4.0
  • requires body-parser > 1.10
$ npm i -S botnaut

Basic setup with Express

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

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));

Keywords

Facebook

FAQs

Package last updated on 25 Sep 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts