Handle errors in group invite

This commit is contained in:
rnhmjoj 2015-06-23 03:18:57 +02:00
parent a564d842c2
commit 622b801143

View File

@ -88,7 +88,11 @@ module.exports = (robot) ->
res.send res.random denied res.send res.random denied
return return
res.send res.random ok res.send res.random ok
run_command "chat_add_user #{chat} #{user}", (reply) -> run_command "chat_add_user #{chat} #{user}", (reply) ->
robot.logger.info "add user #{user} to chat #{chat}" robot.logger.info "add user #{user} to chat #{chat}"
robot.logger.info 'result: ' + reply robot.logger.info 'result: ' + reply
res.send res.random done if (reply.split ' ')[-1..][0] is 'USER_NOT_MUTUAL_CONTACT'
res.send 'aah, non posso: ho bisogno del tuo contatto'
else
res.send res.random done