Как взаимодействовать с контактом в aiogram 3.x?

Есть кнопка.

types.KeyboardButton(text="Поделится", request_contact=True

Как брать с нее данные, чтоб сохранить

contact = message.contact
user_id = message.from_user.id
bot_data = read_data(file_path)
user_info = bot_data[user_data]
new_user_data = {
     "user_id": message.chat_shared.request_id,
     "first_name": contact.first_name,
     "last_name": contact.last_name,
     "phone_number": contact.phone_number
}
bot_data[user_id] = new_user_data
write_data(file_path, bot_data)

И чтоб выводило "Данные сохранены"


Ответы (0 шт):