From ee46036750fdeb2a4ad8325e5e9b5b66956e0abd Mon Sep 17 00:00:00 2001 From: Michael Ball Date: Mon, 2 Nov 2015 19:23:14 -0800 Subject: [PATCH] cleanup logs and try to use user.name as fallback --- src/alias.coffee | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/alias.coffee b/src/alias.coffee index ccf7ad6..5881a66 100644 --- a/src/alias.coffee +++ b/src/alias.coffee @@ -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) -> @@ -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. @@ -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) \ No newline at end of file