Eleirbag89 / TelegramBotPHP

A very simple PHP Telegram Bot API for sending messages.
http://eleirbag89.github.io/TelegramBotPHP
MIT License
807 stars 341 forks source link

get phone number #179

Closed mostafafayyaz closed 4 years ago

mostafafayyaz commented 5 years ago

hello how i can get phone_number ? i use this code for request number . when i what to get number, everything is empty buildKeyBoardButton("text", true)

$phone_number= $telegram->PhoneNumber();

M3hdi-Rostami commented 5 years ago

$option = array(array($telegram->buildKeyboardButton("Allow receipt of mobile number",true))); $keyb = $telegram->buildInlineKeyBoard($option, $onetime=false); $content = array('chat_id' => $chat_id, 'reply_markup' => $keyb, 'text' => "Press the button below to give permission to remove the phone number"); $telegram->sendMessage($content);