# botkit-fb-quick-reply

> A botkit middleware to handle Facebook Messenger quick reply in an intuitive manner

Latest version **0.1.0** (published 2018-06-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install botkit-fb-quick-reply
pnpm add botkit-fb-quick-reply
yarn add botkit-fb-quick-reply
bun add botkit-fb-quick-reply
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2018-06-01 |
| First published | 2018-06-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4 |
| Dependencies | 0 |
| Unpacked size | 4.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | brh55 |
| Maintainers | jasonwalsh |
| Keywords | botkit middleware, facebook messenger, quick replies, messenger quick reply |

## Links

- npm: https://www.npmjs.com/package/botkit-fb-quick-reply
- Repository: https://github.com/mako-ai/botkit-fb-quick-reply
- Homepage: https://github.com/mako-ai/botkit-fb-quick-reply#readme
- Issues: https://github.com/mako-ai/botkit-fb-quick-reply/issues
- npm.io page: https://npm.io/package/botkit-fb-quick-reply

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.1.0 (latest) — 2018-06-01

## README

# botkit-fb-quick-reply [![Build Status](https://travis-ci.com/mako-ai/botkit-fb-quick-reply.svg?branch=master)](https://travis-ci.com/mako-ai/botkit-fb-quick-reply)

> A Botkit middleware to handle Facebook Messenger's quick reply in an intuitive manner

Using this [Botkit](https://github.com/howdyai/botkit) middleware allows your controller to "listen" on Facebook Messenger quick reply payloads instead of the quick reply label/text. In addition, it also supports backwards compatibility to prevent breaking any existing code.

The message object is updated to the following:
```js
message.payload = message.quick_reply.payload;
message.text = message.quick_reply.payload;
message.label = message.quick_reply.text;
message.type = eventName || 'facebook_quick_reply';
```

## Install

```
$ npm install --save botkit-fb-quick-reply
```

## Usage

```js
const quickReplyMiddleware = require('botkit-fb-quick-reply');

// Load middleware
quickReplyMiddleware(controller);
// Now controller can handle "facebook_quick_reply" events and set messages accordingly
// messages.label = quick reply text label
// message.payload = quick reply payload

// Listen to events by the payload
controller.hears('MY_QUICK_REPLY_PAYLOAD', 'facebook_quick_reply', doSomething);

// Listen to a payload that can be provided from a postback OR quick reply
controller.hears('MY_QUICK_REPLY_PAYLOAD', ['facebook_quick_reply', 'facebook_postback'], doSomethingElse);
```


## API

### botkitFbQuickReply(controller [, options])

#### controller
Type: `object`

A botkit configured controller

#### options
Configure the middleware

##### options.eventName
Type: `string`<br>
Default: `facebook_quick_reply`

Override the default quick reply event name. For example, you can use `facebook_postback` if you feel have overlapping functionalities from the menu or quick replies.

##### options.backwardsCompatibility
Type: `boolean`<br>
Default: `false`

This will trigger both a `message_received` in the default behavior, and in the new `facebook_quick_reply` event. Thus activate this if you want backwards compability, but want to use the newer means of handling quick reply events.

## License

MIT © [Mako AI](https://github.com/mako-ai/botkit-fb-quick-reply)

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