slack-robot
slack-robot copied to clipboard
Missing docs for ACL
ACL behaves similar to middleware in express
robot.listen('message', function (req, res) {
// do something
return res.text('Yo').send()
})
.acl(function (req, res, next) {
// check for condition
if (req.channel.type !== 'dm') {
return next();
}
return res.text('sorry, no dm allowed').send();
});
also support multiple acls
robot.listen('message', handlerCallback).acl(noDM, fromAdmin);
function noDM(req, res, next) {
// first condition
next();
};
function fromAdmin(req, res, next) {
// second condition
next();
};