Bottender

A framework for building conversational user interfaces.

README

Bottender

npm Build Status coverage License: MIT PRs Welcome join chat Gitpod Ready-to-Code Follow @bottenderjs

undefined

The readme below is the documentation for the v1 (stable) version of Bottender. To view the documentation:

>

- for the latest Bottender version (v1.x), visit https://bottender.js.org/docs/

- for the legacy Bottender version (v0.15), visit https://bottender.js.org/docs/0.15.17/


- Declarative - Bottender takes care of the complexity of conversational UIs for you. Design actions for each event and state in your application, and Bottender will run accordingly. This approach makes your code more predictable and easier to debug.

- Native User Experience - Bottender lets you create apps on every channel and never compromise on your users’ experience. You can apply progressive enhancement or graceful degradation strategy on your building blocks.

- Easy Setup - With Bottender, you only need a few configurations to make your bot work with channels, automatic server listening, webhook setup, signature verification and so much more.

- Ready for Production - There are thousands of bots powered by Bottender. It has been optimized for real world use cases, automatic batching request and dozens of other compelling features.

Bottender is built on top of

Installation


You can create a new Bottender app using the CLI tools:

  1. ```sh
  2. npx create-bottender-app my-app
  3. ```

Installation may fail on Windows during compilation of the native dependencies with node-gyp. To solve this problem, you can install [windows-build-tools](https://github.com/felixrieseberg/windows-build-tools#readme) or check [node-gyp documentation](https://github.com/nodejs/node-gyp#on-windows).

Documentation


You can find the Bottender documentation on the website.

Check out the Getting Started page for a quick overview.

Community

join chat

You can discuss anything about Bottender or chatbot development in our Discord Server. Join now!

Examples


We have a bunch of examples in the
examples folder.
Here is the first one to get you started:

  1. ``` js
  2. // index.js
  3. const { router, text } = require('bottender/router');

  4. async function SayHi(context) {
  5.   await context.sendText('Hi!');
  6. }

  7. async function Unknown(context) {
  8.   await context.sendText('Sorry, I don’t know what you say.');
  9. }

  10. module.export = function App(context) {
  11.   return router([text('hi', SayHi), text('*', Unknown)]);
  12. };
  13. ```

Notable Features


Messenger


- Messenger Profile Sync
- Attachment Upload
- Handover Protocol
- Persona
- Built-in NLP
- Multiple Pages

LINE


- Reply, Push, Multicast, Narrowcast
- Imagemap
- Rich menu
- Room, Group Chat
- Beacon
- Icon Switch
- Line Notify
- LIFF (LINE Front-end Framework)

Slack


- Channel Chat
- Interactive Message
- Slash Command

Telegram


- Webhook, Long Polling
- Updating, Deleting Messages
- Keyboard
- Group Chat
- Inline Query
- Message Live Location
- Payment

Viber


- Subscribed, Unsubscribed Event
- Delivered, Seen Event

Ecosystem


- bottender-compose - An utility library for Bottender and higher-order handlers.

Contributing


Pull Requests and issue reports are welcome. You can follow steps below to submit your pull requests:

Fork, then clone the repo:

  1. ```sh
  2. git clone git@github.com:your-username/bottender.git
  3. ```

Install the dependencies:

  1. ```sh
  2. cd bottender
  3. yarn
  4. ```

Make sure the tests pass (including ESLint, TypeScript checks and Jest tests):

  1. ```sh
  2. yarn test
  3. ```

Make your changes and tests, and make sure the tests pass.

Contribute using the online one-click setup


You can use Gitpod(a free online VS Code-like) for contributing. With a single click it will launch a workspace and automatically:

- clone the bottender repo.
- install the dependencies.
- run yarn run start.

So that you can start straight away.
Open in Gitpod

License


MIT © Yoctol