Skip to content

Commit

Permalink
cleanup logs and try to use user.name as fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
cycomachead committed Nov 3, 2015
1 parent 6db02e1 commit ee46036
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/alias.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ buildGroupObject = () ->
'@' + val[1].split(',').join(' @')])
# Convert 2D list to native object
groupCache = _.object(staticGroups)
console.log groupCache
return groupCache

getGroups = (match) ->
Expand All @@ -48,7 +47,8 @@ getGroups = (match) ->

# Replace aliases with @mentions in the message
expand = (message, user) ->
filterName = user.mention_name || user[user_prop]
# mention_name is for Hipchat
filterName = user[user_prop] || user.mention_name || user.name
groups = getGroups(message.match)
for own alias, members of groups
# Filter inviduals from their own messages.
Expand Down Expand Up @@ -77,6 +77,5 @@ module.exports = (robot) ->
return

regex = buildRegExp()
console.log 'REGEX', regex
robot.hear regex, (msg) ->
msg.send expand(msg.message.text, msg.message.user)

0 comments on commit ee46036

Please sign in to comment.