0.1.0 • Published 5 years ago

cpn-hook v0.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

Captain Hook

A nice framework to make chatbot development easier

Quick Start

Getting a development server up and running is quite easy

const bot = new Bot({
  console: new ConsoleIntegration(),
});

bot.use(
  BotRequestLogger.middleware((data) => {
    console.log(
      'REQUEST -',
      data.ms + 'ms',
      '\n' + JSON.stringify({ raw: data.context.rawRequest, user: data.context.user }, null, 2),
    );
  }),
);

bot.use(userExtractor());

const server = new WebhookServer(3000, bot, {});

server.start();