https://github.com/bottenderjs/bottender-botimize
Middleware for using Botimize with Bottender.
https://github.com/bottenderjs/bottender-botimize
botimize bottender
Last synced: 11 months ago
JSON representation
Middleware for using Botimize with Bottender.
- Host: GitHub
- URL: https://github.com/bottenderjs/bottender-botimize
- Owner: bottenderjs
- License: mit
- Created: 2017-12-04T10:16:54.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-12-08T08:42:58.000Z (over 8 years ago)
- Last Synced: 2025-05-20T12:11:39.493Z (about 1 year ago)
- Topics: botimize, bottender
- Language: JavaScript
- Size: 49.8 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Bottender Botimize
[](https://www.npmjs.com/package/bottender-botimize)
[](https://travis-ci.org/bottenderjs/bottender-botimize)
[](https://opensource.org/licenses/MIT)
> Middleware for using [Botimize](https://www.getbotimize.com/) with
> [Bottender](https://github.com/Yoctol/bottender).
## Installation
```sh
npm install bottender-botimize
```
## Example
```js
const { MessengerBot } = require('bottender');
const { createServer } = require('bottender/express');
const botimizeMiddleware = require('bottender-botimize/express');
const bot = new MessengerBot({
accessToken: '__FILL_YOUR_TOKEN_HERE__',
appSecret: '__FILL_YOUR_SECRET_HERE__',
});
bot.onEvent(async context => {
await context.sendText('Hello World');
});
const server = createServer(bot, {
verifyToken: '__FILL_YOUR_VERIFY_TOKEN_HERE__',
webhookMiddleware: botimizeMiddleware(bot, {
apiKey: '__FILL_YOUR_BOTIMIZE_KEY_HERE__',
platform: 'facebook',
}),
});
server.listen(5000, () => {
console.log('server is running on 5000 port...');
});
```
## Server
Supported servers:
* express
* koa
### [express](https://github.com/expressjs/express)
```js
const botimizeMiddleware = require('bottender-botimize/express');
```
### [koa](https://github.com/koajs/koa)
```js
const botimizeMiddleware = require('bottender-botimize/koa');
```
## Contributing
Pull Requests and issue reports are welcome. You can follow steps below to
submit your pull requests:
Fork, then clone the repo:
```sh
git clone git@github.com:your-username/bottender-botimize.git
```
Install the dependencies:
```sh
cd bottender-botimize
yarn
```
Make sure the tests pass (including eslint, flow checks and jest tests):
```sh
yarn test
```
Make your changes and tests, and make sure the tests pass.
## License
MIT © [Yoctol](https://github.com/bottenderjs/bottender-botimize)