Skip to content

Commit

Permalink
Send message only once
Browse files Browse the repository at this point in the history
  • Loading branch information
bognix committed Jun 1, 2016
1 parent 6ddf0e3 commit 58d1f24
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,12 @@ rtm.on(RTM_EVENTS.MESSAGE, function (message) {
}

if (message.text && RELEASE_PATTERN.test(message.text)) {
var msg = '<@' + message.user + '> ';

releaseSandbox(message)
.then(function (data) {
msg += ':+1:';
if (data.response) {
rtm.sendMessage(data.response, message.channel);
} else {
var msg = '<@' + message.user + '> :+1:';
}
rtm.sendMessage(msg, message.channel)
})
Expand Down

0 comments on commit 58d1f24

Please sign in to comment.