1.2.1 • Published 6 years ago

@kiina/bot-controller v1.2.1

Weekly downloads
1
License
ISC
Repository
-
Last release
6 years ago

Bot Controller

This package exports a Class meant for controlling the bot setup and environment configuration.

Installation

npm install @kiina/bot-controller

Usage

const BotController = require('@kiina/bot-controller');

const botProviders = [
  {
    type: require('botmaster-messenger'),
    config: {
      credentials: {
        verifyToken: '<fb-verify-token>',
        pageToken: '<fb-page-token>',
        fbAppSecret: '<fb-app-secret>',
      },
      webhookEndpoint: 'fb-endpoint' // http://my-host.com/messenger/<webhookEndpoint>
    }
  }
];

const bot = new BotController(botProviders);

const exampleMiddleware = {
  type: 'incoming',
  name: 'example',
  controller: async (bot, update) => {
    return bot.reply(update, 'Hello world!');
  }
};

controller.addMiddleware(exampleMiddleware);
1.2.1

6 years ago

1.2.0

6 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago