Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #361 from rlipman/roles-hyphen-bugfix
Escape the hyphens in the roles regexes
  • Loading branch information
technicalpickles committed Oct 27, 2012
2 parents 7f94fe0 + 841dde3 commit 4571d54
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/scripts/roles.coffee
Expand Up @@ -15,7 +15,7 @@ module.exports = (robot) ->
getAmbiguousUserText = (users) ->
"Be more specific, I know #{users.length} people named like that: #{(user.name for user in users).join(", ")}"

robot.respond /who is @?([\w .-]+)\?*$/i, (msg) ->
robot.respond /who is @?([\w .\-]+)\?*$/i, (msg) ->
joiner = ', '
name = msg.match[1].trim()

Expand All @@ -39,7 +39,7 @@ module.exports = (robot) ->
else
msg.send "#{name}? Never heard of 'em"

robot.respond /@?([\w .-_]+) is (["'\w: -_]+)[.!]*$/i, (msg) ->
robot.respond /@?([\w .\-_]+) is (["'\w: \-_]+)[.!]*$/i, (msg) ->
name = msg.match[1].trim()
newRole = msg.match[2].trim()

Expand All @@ -63,7 +63,7 @@ module.exports = (robot) ->
else
msg.send "I don't know anything about #{name}."

robot.respond /@?([\w .-_]+) is not (["'\w: -_]+)[.!]*$/i, (msg) ->
robot.respond /@?([\w .\-_]+) is not (["'\w: \-_]+)[.!]*$/i, (msg) ->
name = msg.match[1].trim()
newRole = msg.match[2].trim()

Expand Down

0 comments on commit 4571d54

Please sign in to comment.