Fix phone number selection

This commit is contained in:
rnhmjoj 2015-06-23 22:44:39 +02:00
parent 13da4c40b7
commit 1f87aa1707

View File

@ -52,7 +52,7 @@ module.exports = (robot) ->
robot.logger.info "create contact for user #{name}"
user_info 'user_info ' + name, (user) ->
[first, last...] = user.name.split ' '
phone = if phone? then phone else user.phone
phone = phone or user.phone
if not phone?
return callback 'serve per forza il tuo numero'
run_command "add_contact #{phone} '#{first}' '#{last.join ' '}'", (reply) ->