UNPKG

351 BJavaScriptView Raw
1/**
2 * Example for creating and working with the Slack RTM API.
3 */
4
5/* eslint no-console:0 */
6
7var RtmClient = require('../lib/clients/rtm/client');
8
9var token = process.env.SLACK_API_TOKEN || '';
10
11var rtm = new RtmClient(token, { logLevel: 'debug' });
12rtm.start();
13
14rtm.on('message', function handleRtmMessage(message) {
15 console.log(message);
16});