hello bot

This commit is contained in:
2017-02-23 13:35:07 +07:00
parent 435414316d
commit f28ab5f2b9
3 changed files with 38 additions and 1 deletions

13
bot.js Normal file
View File

@@ -0,0 +1,13 @@
module.exports = function (req, res, next) {
var userName = req.body.user_name;
var botPayload = {
text : 'Hello, ' + userName + '!'
};
// avoid infinite loop
if (userName !== 'slackbot') {
return res.status(200).json(botPayload);
} else {
return res.status(200).end();
}
}