8π
β
I am not sure with django-telegrambot
. But if Iβm not wrong your reply_markup
is the one under python-telegram-bot
. When the button is pressed, the userβs phone number will be sent to your bot as a Contact
object. You can catch it with a MessageHandler
and a Filters.contact
filter.
from telegram.ext import MessageHander, Filters
def contact_callback(bot, update):
contact = update.effective_message.contact
phone = contact.phone_number
dispatcher.add_handler(MessageHandler(Filters.contact, contact_callback))
π€jeffffc
Source:stackexchange.com