sarah-slack
v0.0.10
Published
This is the Slack trigger for the Sarah platform.
Downloads
12
Readme
Sarah-Slack
Features
Channel
- New message
- User is typing
Sample code
module.exports = function(domain) {
var slack = domain.trigger('Slack');
//Listen to every channel for a new message
slack.channels().on('message', (channel, message, user) => {
console.log(message.text);
});
//Get the 'general' channel
var general = slack.channel('general');
//When a new message is send in slack
general.on('message', (channel, message, user) => {
console.log(message.text);
});
//When a certain user is typing
general.on('user_typing', (user, channel) => {
console.log(channel.name);
});
});
Tests
Currently we have a couple of unit tests, you can run them using the npm test
command.
Known issues
The slack API we use in sarah-slack has a lot of options, events and methods. It's up to us to implement them all. Unfortunately there are only two events supported right now..