Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Roles will correctly semicolon-delimit the list of roles if one conta…

…ins a comma.
  • Loading branch information...
commit 702b51871424eef244d5452f635845f0eb08d658 1 parent 35fb4d2
@futuraprime authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/scripts/roles.coffee
View
5 src/scripts/roles.coffee
@@ -16,6 +16,7 @@ module.exports = (robot) ->
"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) ->
+ joiner = ', '
name = msg.match[1].trim()
if name is "you"
@@ -28,7 +29,9 @@ module.exports = (robot) ->
user = users[0]
user.roles = user.roles or [ ]
if user.roles.length > 0
- msg.send "#{name} is #{user.roles.join(", ")}."
+ if user.roles.join('').search(',') > -1
+ joiner = '; '
+ msg.send "#{name} is #{user.roles.join(joiner)}."
else
msg.send "#{name} is nothing to me."
else if users.length > 1
Please sign in to comment.
Something went wrong with that request. Please try again.