# botpress-msbotfw

> Microsoft Bot Framework connector

Latest version **1.1.13** (published 2017-12-10) · Botpress Proprietary License license · 0 weekly downloads

## Install

```sh
npm install botpress-msbotfw
pnpm add botpress-msbotfw
yarn add botpress-msbotfw
bun add botpress-msbotfw
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.13 |
| Published | 2017-12-10 |
| First published | 2017-11-20 |
| Weekly downloads | 0 |
| License | Botpress Proprietary License |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+25 in 1 direct dependencies) |
| Install scripts | no |
| Author | ELENOSE |
| Maintainers | hmphu |

## Links

- npm: https://www.npmjs.com/package/botpress-msbotfw
- npm.io page: https://npm.io/package/botpress-msbotfw

## Dependencies (2)

- [axios](https://npm.io/package/axios.md) ^0.17.1
- [botbuilder](https://npm.io/package/botbuilder.md) ^3.13.1

## Recent versions

- 1.1.13 (latest) — 2017-12-10
- 1.1.12 — 2017-12-02
- 1.1.11 — 2017-11-26
- 1.1.10 — 2017-11-23
- 1.0.9 — 2017-11-23
- 1.0.8 — 2017-11-23
- 1.0.7 — 2017-11-22
- 1.0.6 — 2017-11-22
- 1.0.5 — 2017-11-22
- 1.0.4 — 2017-11-22
- 1.0.3 — 2017-11-22
- 1.0.2 — 2017-11-20
- 1.0.1 — 2017-11-20
- 1.0.0 — 2017-11-20

## README

# Microsoft Bot Framework connector for [Botpress](https://botpress.io/)


## Installation

```
botpress install botpress-msbotfw
```

## Get started

#### 1. Create a bot on [Bot Framework Developer Dashboard](https://docs.botframework.com/en-us/csharp/builder/sdkreference/gettingstarted.html#registering)

#### 2. Setup Application Key & Password

To setup connection of your chatbot, you need to fill the application configurations directly in the module interface. 

<img alt='Connexion settings' src='assets/settings.png' width='700px'/>

You can also

- Set the bot application ID in env var MSBOTFW_APP_ID 
- Set the bot application password in env var MSBOTFW_APP_PASSWORD

#### 3. Set the webhook url in [Bot Framework config](https://docs.botframework.com/en-us/csharp/builder/sdkreference/gettingstarted.html#registering)

The messaging endpoint must be **https://YOUR_DOMAIN/api/botpress-msbotfw/messages**


## Usage

### Incoming

You can listen to incoming events easily with Botpress by using the built-in "hear" function.
```js
bp.hear({platform: 'msbotfw', type: 'message'}, (event, next) => {
    const text = event.text
    const session = event.session
    
    bp.msbotfw.sendText(session, `You said ${text}`)
})
```

### Outgoing

#### Text messages
```js
bp.msbotfw.sendText(session, 'aMessage')
```

#### Attachments

You can use the [Bot Framework attachment API described here](https://docs.botframework.com/en-us/csharp/builder/sdkreference/attachments.html)

You can see [how it is rendered on different platforms here](https://docs.botframework.com/en-us/channel-inspector/channels/Facebook)

```js
bp.msbotfw.sendAttachment(session, {
    'contentType': 'application/vnd.microsoft.card.hero',
    'content': {
      'title': 'Who is it?',
      'subtitle': 'Guess who is on the picture',
      "images": [
        {
          "url": "https://upload.wikimedia.org/wikipedia/en/a/a6/Bender_Rodriguez.png"
        }
      ],
      'buttons': [
        {
            'type': 'postBack',
            'title': 'Bender Rodriguez',
            'value': 'insert_your_postback'
        },
        {
            'type': 'postBack',
            'title': 'R2D2',
            'value': 'insert_your_postback'
        }
      ]
    }
  })
```

---
_Source: https://npm.io/package/botpress-msbotfw · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
