Telegram::buildKeyboardButton PHP Method

buildKeyboardButton() public method

\param $text String; Array of button rows, each represented by an Array of Strings \param $request_contact Boolean Optional. If True, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only \param $request_location Boolean Optional. If True, the user's current location will be sent when the button is pressed. Available in private chats only \return the requested button as Array
public buildKeyboardButton ( $text, $request_contact = false, $request_location = false )
    public function buildKeyboardButton($text, $request_contact = false, $request_location = false)
    {
        $replyMarkup = array('text' => $text, 'request_contact' => $request_contact, 'request_location' => $request_location);
        if ($url != "") {
            $replyMarkup['url'] = $url;
        } else {
            if ($callback_data != "") {
                $replyMarkup['callback_data'] = $callback_data;
            } else {
                if ($switch_inline_query != "") {
                    $replyMarkup['switch_inline_query'] = $switch_inline_query;
                }
            }
        }
        return $replyMarkup;
    }