slack-client
Version:
A library for creating a Slack client
17 lines (11 loc) • 351 B
JavaScript
/**
* Example for creating and working with the Slack RTM API.
*/
/* eslint no-console:0 */
var RtmClient = require('../lib/clients/rtm/client');
var token = process.env.SLACK_API_TOKEN || '';
var rtm = new RtmClient(token, { logLevel: 'debug' });
rtm.start();
rtm.on('message', function handleRtmMessage(message) {
console.log(message);
});