Git Product home page Git Product logo

bottender's Introduction

Bottender

npm CircleCI coverage License: MIT

  • 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.

Documentation

You can find the Bottender documentation on the website.

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.

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

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 [email protected]: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

bottender's People

Contributors

chentsulin avatar tw0517tw avatar kpman avatar homerchen19 avatar littlewhiteya avatar calvin-lin avatar lrills avatar storyn26383 avatar kidkcl avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.