Fix phone number selection
This commit is contained in:
parent
13da4c40b7
commit
1f87aa1707
@ -52,7 +52,7 @@ module.exports = (robot) ->
|
|||||||
robot.logger.info "create contact for user #{name}"
|
robot.logger.info "create contact for user #{name}"
|
||||||
user_info 'user_info ' + name, (user) ->
|
user_info 'user_info ' + name, (user) ->
|
||||||
[first, last...] = user.name.split ' '
|
[first, last...] = user.name.split ' '
|
||||||
phone = if phone? then phone else user.phone
|
phone = phone or user.phone
|
||||||
if not phone?
|
if not phone?
|
||||||
return callback 'serve per forza il tuo numero'
|
return callback 'serve per forza il tuo numero'
|
||||||
run_command "add_contact #{phone} '#{first}' '#{last.join ' '}'", (reply) ->
|
run_command "add_contact #{phone} '#{first}' '#{last.join ' '}'", (reply) ->
|
||||||
|
Loading…
Reference in New Issue
Block a user