mirror of
https://github.com/Dannecron/hello-slack-bot.git
synced 2025-12-25 16:12:34 +03:00
some changes
This commit is contained in:
13
hello.js
Normal file
13
hello.js
Normal 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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user