0.2.0 • Published 6 years ago

botnaut-botservice v0.2.0

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

Azure Bot Service connector for Botnaut

Botnaut

Requirements and installation

  • requires nodejs > 6.0

    $ npm i -S botnaut-botservice

Connector usage

const { Hook, Router, Request } = require('botnaut');
const { createProcessor, createHandler } = require('botnaut/serverlessAWS');
const { createBotServiceConnector } = require('botnaut-botservice');

const options = {
    azure: {
      uri: 'azure-oauth-login-uri',
      grant_type: 'grant-type-here',
      scope: 'token-scope-here',
      client_id: 'azure-client-id (App ID)',
      client_secret: 'azure-client-secret (App Password)',
      welcomeAction: 'welcome-action' // optional postback action to start the conversation
}

const bot = new Router();
const botServiceConnector = createBotServiceConnector(options, Request);

const processor = createProcessor(bot, options});
const hook = new Hook(processor, botServiceConnector);

const handler = createHandler(hook, 'bot-token', console);

Contributing

  • Follow AirBnB style guide
  • Mind the Gitflow workflow
  • Check ESLint settings in .eslintrc and ensure your ESLint is enabled
  • (do the magick)
  • run npm test to ensure everything is fine
  • create feature branch at your fork and make pull request to upstream (ask App Owner)