Eleirbag89 / TelegramBotPHP

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

request_location acts like request_contact?! #115

Closed ghost closed 7 years ago

ghost commented 7 years ago

Hi,

The following code supposed to request for user's location, but it asks about sharing phone number, instead.

$option = array(array($telegram->buildKeyboardButton("Button",$request_location=true)));
$keyb = $telegram->buildKeyBoard($option, $onetime=false);

$content = array('chat_id' => $chat_id, 'reply_markup' => $keyb, 'text' => "This is a Keyboard Test");
$telegram->sendMessage($content);

Is request_location implemented in this API? Thanks

ghost commented 7 years ago

OK, I got it finally.

All the three parameters should be defined. Otherwise, the second one acts as request_contact. So I changed the code to the following, and it worked like a charm.

$option = array(array($telegram->buildKeyboardButton("Button",false,true)));