Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the example respond when "Hello." is said instead of every message #337

Merged
merged 1 commit into from May 17, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions docs/_pages/bots.md
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);
 }
});
```