tmallbot
v0.0.2
Published
天猫精灵Node库
Downloads
2
Readme
tmallbot
天猫精灵Node库
Installation
$ npm i tmallbot
Use with Connect/Express
let tmallbot = require('tmallbot');
let config = {};
app.use(express.query());
app.use('/tmallbot', tmallbot(config, function (req, res, next) {
var data = req.body;
if (data.utterance === '你好!') {
res.reply('你也好');
} else if (data.utterance === '我想听音乐') {
res.reply('你想听谁的音乐?', 'ASK_INFO');
} else {
res.reply({
"returnCode": 0,
"returnErrorSolution": "",
"returnMessage": "",
"returnValue": {
"reply": "Hello World!!!",
"resultType": "RESULT",
"actions": [],
"properties": {},
"executeCode": "SUCCESS",
"msgInfo": ""
}
});
}
}));