Skip to content

Commit 273e8dc

Browse files
committed
Merge pull request #8 from Ondama/master
Updated matching expressions
2 parents 63739c6 + 5366ac9 commit 273e8dc

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)