@3846masa/linebot 中文文档教程
@3846masa/linebot
用于 Node.js 的 LINE BOT API 包装器
Docs
https://3846masa.github.io/node-linebot/
Install
npm install --save @3846masa/linebot
Usage
const LineBot = require('@3846masa/linebot/lib/LineBot').LineBot;
const bot = new LineBot({
channelSecret: 'XXXXXXXXXX',
channelToken: 'XXXXXXXXXX',
});
bot.on('webhook:*', (ev) => {
console.log('You got a event!', ev);
});
bot.on('webhook:message', (ev) => {
const message = ev.message;
ev.reply(message);
});
bot.listen(process.env.PORT || 3000);
请参阅示例。
LICENSE
MIT (c) 3846masa
Author
3846masa
@3846masa/linebot
LINE BOT API wrapper for Node.js
Docs
https://3846masa.github.io/node-linebot/
Install
npm install --save @3846masa/linebot
Usage
const LineBot = require('@3846masa/linebot/lib/LineBot').LineBot;
const bot = new LineBot({
channelSecret: 'XXXXXXXXXX',
channelToken: 'XXXXXXXXXX',
});
bot.on('webhook:*', (ev) => {
console.log('You got a event!', ev);
});
bot.on('webhook:message', (ev) => {
const message = ev.message;
ev.reply(message);
});
bot.listen(process.env.PORT || 3000);
See examples.
LICENSE
MIT (c) 3846masa
Author
3846masa