Skip to content

Commit 5366ac9

Browse files
committed
Update thank-you.coffee
1 parent 63739c6 commit 5366ac9

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/thank-you.coffee

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,8 @@ response = [
3232
]
3333

3434
module.exports = (robot) ->
35-
robot.respond /(thank).*/i, (msg) ->
35+
robot.respond /thank(s| you)/i, (msg) ->
36+
msg.send msg.random response
37+
thanks = new RegExp "thank(s| you) #{robot.name}", "i"
38+
robot.hear thanks, (msg) ->
3639
msg.send msg.random response
37-
38-
robot.hear /thanks? (.*)/i, (msg) ->
39-
name = msg.match[1]
40-
if (name.toLowerCase().indexOf robot.name.toLowerCase()) > -1
41-
msg.send msg.random response

0 commit comments

Comments
 (0)