The Wayback Machine - https://web.archive.org/web/20190426183802/https://github.com/Yoctol/bottender
Skip to content
⚡️ Make Bots Your Way. Fast and Flexible.
Branch: master
Clone or download
Latest commit 06acfec Mar 8, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci forzen lockfile in CI (#318) Jul 25, 2018
__mocks__ add tests for line context batch Apr 16, 2018
bin remove babel-register Oct 27, 2017
examples messenger-batch-multi-pages Jan 30, 2019
src [LINE] move verify webhook check out of session creation Feb 21, 2019
test Print unhandled rejction when test Aug 15, 2017
.babelrc.js Upgrade to Babel 7 (#300) Jul 9, 2018
.editorconfig
.eslintignore upgrade deps and fix lint (#334) Sep 16, 2018
.eslintrc.js fix all lint errors Oct 26, 2017
.flowconfig upgrade deps and fix lint (#334) Sep 16, 2018
.gitignore build before publish (#32) Jun 2, 2017
CHANGELOG.md 0.15.17 changelog Feb 1, 2019
LICENSE rename project to bottender & add MIT license (#515) Oct 19, 2017
README.md add bottender-compose to Ecosystem Sep 18, 2018
codecov.yml Decrease target coverage Oct 30, 2018
express.js Added entry files for submodule require Jul 11, 2017
koa.js Added entry files for submodule require Jul 11, 2017
micro.js Added entry files for submodule require Jul 11, 2017
package.json
restify.js Added entry files for submodule require Jul 11, 2017
test-utils.js Added with-unit-tests example (#494) Oct 17, 2017
utils.js Export utils as top level module Nov 27, 2017
yarn.lock bump messaging-apis Mar 8, 2019

README.md

Bottender

npm npm@next CircleCI coverage License: MIT PRs Welcome join chat

  • Flexible - Declare handlers as any JavaScript function.

  • Modern - Source written with ES6/ES7 syntax and great async await supports.

  • Modular - Use session stores, server framework adapters and platform connectors with same interface.

  • Learn Once, Write Anywhere - Handle multiple platforms with consistent development experience.

Bottender is built on top of Messaging APIs.

Installation

You can install Bottender globally to use the cli tools:

npm install -g bottender

Or install it locally to use it programmatically:

npm install bottender

Installation may fail on Windows during compilation of the native dependencies with node-gyp. To solve this problem, you can install windows-build-tools or check node-gyp documentation.

Documentation

You can find the Bottender documentation on the website.

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:

const { ConsoleBot } = require('bottender');

const bot = new ConsoleBot();

bot.onEvent(async context => {
  await context.sendText('Hello World');
});

bot.createRuntime();

This will create and run a bot which always reply "Hello World" in the console.

You'll notice that there is an async function to be passed to the onEvent method, we call it handler. You can put your bot logic in there.

Notable Features

Messenger

  • Messenger Profile Sync
  • Attachment Upload
  • Handover Protocol
  • Targeting Broadcast Messages
  • Built-in NLP
  • Multiple Pages

LINE

  • Reply, Push, Multicast
  • Imagemap
  • Rich Menu
  • Room, Group Chat
  • Beacon

Slack

  • Channel Chat
  • Interactive Message

Telegram

  • Webhook, Long Polling
  • Update, Delete Messages
  • Keyboard
  • Group Chat
  • Inline Query
  • Message Live Location
  • Payment

Viber

  • Subscribed, Unsubscribed Event
  • Delivered, Seen Event

Ecosystem

Introduction Video

Contributing

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

Fork, then clone the repo:

git clone git@github.com:your-username/bottender.git

Install the dependencies:

cd bottender
yarn

Make sure the tests pass (including eslint, flow checks and jest tests):

yarn test

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

License

MIT © Yoctol

You can’t perform that action at this time.