V
V
VKR2282021-01-16 23:22:16
Python
VKR228, 2021-01-16 23:22:16

The user sends me his contact (photo), how can I write it to the database, and more specifically, how to get the phone number and then write it down?

How to get phone number from sent contact?
60034aef02834558956629.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
MinTnt, 2021-01-17
@MinTnt

Would this answer work?

@bot.message_handler(content_types=['contact'])
def start(message):
  print(message.contact.phone_number)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question