This is a framework make you create chatbot more easily.
Support FB and LINE platform.
The framework highly depends on async function syntax, the use of sql and ssl server, so you must make sure your runtime meets the following requirements:
You can find the framework documentation on the website.
- Getting Started
- Plugin
- Platforms
- API Reference
// Bot.js
// bot settings
const
connection_manager = require('./connection_manager.js'),
server = connection_manager.server,
bot = new connection_manager(8080);
server.post('/', async function(req, res, next){
bot.lineVerify(req, res);
let platform = bot.getPlatform(req);
bot.connect(platform, req, res);
reply = await bot.messageHandler(platform, 'Hello world!');
bot.sendAPI(platform, 'reply', req, reply);
});
server.get('/', function(req, res, next){
bot.fbSubscribe(req, res);
});
Build the script under the main folder, remember to set your key in the file key_config.ini and run js file with the command node <filename>.js
.
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/sm-bot-framework.git
Install the dependencies:
cd sm-bot-framework 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.