From d1b561648dfd856a890131b0f994c2946fa98e4b Mon Sep 17 00:00:00 2001 From: roach Date: Fri, 17 Feb 2017 10:46:43 -0800 Subject: [PATCH] Updated RTM message receiving docs --- docs/_pages/bots.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/_pages/bots.md b/docs/_pages/bots.md index 7b3ab7359..1156c41ec 100644 --- a/docs/_pages/bots.md +++ b/docs/_pages/bots.md @@ -103,15 +103,16 @@ and that we receive over the RTM connection. We can subscribe to `message` event ```js var RtmClient = require('@slack/client').RtmClient; - +var RTM_EVENTS = require('@slack/client').RTM_EVENTS; var bot_token = process.env.SLACK_BOT_TOKEN || ''; var rtm = new RtmClient(bot_token); -rtm.start(); rtm.on(RTM_EVENTS.MESSAGE, function handleRtmMessage(message) { console.log('Message:', message); //this is no doubt the lamest possible message handler, but you get the idea }); + +rtm.start(); ``` --------