Skip to content

Commit

Permalink
Merge pull request #337 from lukeb-uk/master
Browse files Browse the repository at this point in the history
Make the example respond when "Hello." is said instead of every message
  • Loading branch information
aoberoi authored May 17, 2017
2 parents 2b8ee33 + b555c33 commit c42de6e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docs/_pages/bots.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,9 @@ var rtm = new RtmClient(bot_token);
rtm.start();

rtm.on(RTM_EVENTS.MESSAGE, function handleRtmMessage(message) {
var channel = "#general"; //could also be a channel, group, DM, or user ID (C1234), or a username (@don)
rtm.sendMessage("Hello <@" + message.user + ">!", message.channel);
 if (message.text === "Hello.") {
   var channel = "#general"; //could also be a channel, group, DM, or user ID (C1234), or a username (@don)
  rtm.sendMessage("Hello <@" + message.user + ">!", message.channel);
 }
});
```

0 comments on commit c42de6e

Please sign in to comment.