UNPKG

5.54 kBMarkdownView Raw
1# Bottender
2
3[![npm](https://img.shields.io/npm/v/bottender.svg)](https://www.npmjs.com/package/bottender)
4[![Build Status](https://github.com/Yoctol/bottender/workflows/Node.js%20CI/badge.svg)](https://github.com/Yoctol/bottender/actions?query=workflow%3ANode.js%20CI+branch%3Amaster)
5[![coverage](https://codecov.io/gh/Yoctol/bottender/branch/master/graph/badge.svg)](https://codecov.io/gh/Yoctol/bottender)
6[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
7[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/Yoctol/bottender#contributing)
8[![join chat](https://img.shields.io/badge/discord-join%20chat-green.svg)](https://discord.gg/apNsWBz)
9[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/Yoctol/bottender)
10[![Follow @bottenderjs](https://img.shields.io/twitter/follow/bottenderjs.svg?label=Follow%20@bottenderjs)](https://twitter.com/intent/follow?screen_name=bottenderjs)
11
12![](https://user-images.githubusercontent.com/3382565/76295244-3c80c800-62ef-11ea-88dc-a6039b3918c2.png)
13
14> The readme below is the documentation for the v1 (stable) version of Bottender. To view the documentation:
15>
16> - for the latest Bottender version (v1.x), visit https://bottender.js.org/docs/en/getting-started
17> - for the legacy Bottender version (v0.15), visit https://bottender.js.org/docs/en/0.15.17/getting-started
18
19- **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.
20
21- **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.
22
23- **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.
24
25- **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.
26
27Bottender is built on top of
28[Messaging APIs](https://github.com/Yoctol/messaging-apis).
29
30## Installation
31
32You can create a new Bottender app using the CLI tools:
33
34```sh
35npx create-bottender-app my-app
36```
37
38Installation 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).
39
40## Documentation
41
42You can find the Bottender documentation [on the website](https://bottender.js.org?new).
43
44Check out the [Getting Started](https://bottender.js.org/docs/en/getting-started) page for a quick overview.
45
46## Community
47
48[![join chat](https://img.shields.io/badge/discord-join%20chat-green.svg)](https://discord.gg/unmFzmR)
49
50You can discuss anything about Bottender or chatbot development in our [Discord](https://discordapp.com/) Server. [Join now!](https://discord.gg/unmFzmR)
51
52## Examples
53
54We have a bunch of examples in the
55[examples](https://github.com/Yoctol/bottender/tree/master/examples) folder.
56Here is the first one to get you started:
57
58```js
59// index.js
60const { router, text } = require('bottender/router');
61
62async function SayHi(context) {
63 await context.sendText('Hi!');
64}
65
66async function Unknown(context) {
67 await context.sendText('Sorry, I don’t know what you say.');
68}
69
70module.export = function App(context) {
71 return router([
72 text('hi', SayHi),
73 text('*', Unknown),
74 ]);
75};
76```
77
78## Notable Features
79
80### Messenger
81
82- Messenger Profile Sync
83- Attachment Upload
84- Handover Protocol
85- Persona
86- Built-in NLP
87- Multiple Pages
88
89### LINE
90
91- Reply, Push, Multicast, Narrowcast
92- Imagemap
93- Rich menu
94- Room, Group Chat
95- Beacon
96- Icon Switch
97- Line Notify
98- LIFF (LINE Front-end Framework)
99
100### Slack
101
102- Channel Chat
103- Interactive Message
104- Slash Command
105
106### Telegram
107
108- Webhook, Long Polling
109- Updating, Deleting Messages
110- Keyboard
111- Group Chat
112- Inline Query
113- Message Live Location
114- Payment
115
116### Viber
117
118- Subscribed, Unsubscribed Event
119- Delivered, Seen Event
120
121## Ecosystem
122
123- [bottender-compose](https://github.com/Yoctol/bottender-compose) - An utility library for Bottender and higher-order handlers.
124
125## Contributing
126
127Pull Requests and issue reports are welcome. You can follow steps below to submit your pull requests:
128
129Fork, then clone the repo:
130
131```sh
132git clone git@github.com:your-username/bottender.git
133```
134
135Install the dependencies:
136
137```sh
138cd bottender
139yarn
140```
141
142Make sure the tests pass (including ESLint, TypeScript checks and Jest tests):
143
144```sh
145yarn test
146```
147
148Make your changes and tests, and make sure the tests pass.
149
150### Contribute using the online one-click setup
151
152You can use Gitpod(a free online VS Code-like) for contributing. With a single click it will launch a workspace and automatically:
153
154- clone the bottender repo.
155- install the dependencies.
156- run `yarn run start`.
157
158So that you can start straight away.
159
160[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/Yoctol/bottender)
161
162## License
163
164MIT © [Yoctol](https://github.com/Yoctol/bottender)