Node's Perpetuum Mobile

    @kiina/bot-controller

    1.2.1 • Public • Published

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

    Keywords

    none

    Install

    npm i @kiina/bot-controller

    DownloadsWeekly Downloads

    3

    Version

    1.2.1

    License

    ISC

    Unpacked Size

    3.34 kB

    Total Files

    4

    Last publish

    Collaborators

    • asalgado
    • eder_kiina
    • antunesmg
    • marcojardim