Skip to content

Instantly share code, notes, and snippets.

@walaura
Created May 7, 2015 17:28
Show Gist options
  • Save walaura/7a72f3cde025301301a8 to your computer and use it in GitHub Desktop.
Save walaura/7a72f3cde025301301a8 to your computer and use it in GitHub Desktop.
var Slack = require('slack-client');
var slack = new Slack('your-token', true, true);
slack.on('open', function() {
for (id in slack.channels) {
if (slack.channels[id].is_member) {
console.log([id,slack.channels[id].name]);
}
}
});
slack.on('error', function(error) {
return console.error("Error: " + error);
});
slack.login();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment