Like using Inline buttons in the telegram to know the phone number?

I can't figure out how to find a phone number via inline buttons in the telegram.
April 19th 20 at 12:35
3 answers
April 19th 20 at 12:37
Does
April 19th 20 at 12:39
Ask him to enter ;)
April 19th 20 at 12:41
use Longman\TelegramBot\Entities\Keyboard;
...
(new Keyboard([
 ['text' => "REGISTRATION", 'request_contact' => true]
 ]))->setOneTimeKeyboard(false)->setResizeKeyboard(true)->setSelective(true)


class SystemCommand extends GenericmessageCommand
{
 public function execute()
{
 $chat_id = $this->getMessage()->getFrom()->getId();
 // if the passed phone 
 $contact = $this->getMessage()->getContact();
 if (is_object($contact)) {
 $contact ID = $contact->getUserId();
 if ($chat_id == $contact ID) {
 // alas, the more authentic I can not check that the sender's phone
 $phone = $contact->getPhoneNumber();

}
}

}
}

Find more questions by tags Telegram