$reply = "Private Chat";
}
// Create option for the custom keyboard. Array of array string
$option = array(array("A", "B"), array("C", "D"));
// Get the keyboard
$keyb = $telegram->buildKeyBoard($option);
$content = array('chat_id' => $chat_id, 'reply_markup' => $keyb, 'text' => $reply);
$telegram->sendMessage($content);
}
if ($text == "/git") {
$reply = "Check me on GitHub: https://github.com/Eleirbag89/TelegramBotPHP";
// Build the reply array
$content = array('chat_id' => $chat_id, 'text' => $reply);
$telegram->sendMessage($content);
}
if ($text == "/img") {
// Load a local file to upload. If is already on Telegram's Servers just pass the resource id
$img = curl_file_create('test.png', 'image/png');
$content = array('chat_id' => $chat_id, 'photo' => $img);
$telegram->sendPhoto($content);
//Download the file just sended
$file_id = $message["photo"][0]["file_id"];
$file = $telegram->getFile($file_id);
$telegram->downloadFile($file["file_path"], "./test_download.png");
}
if ($text == "/where") {
// Send the Catania's coordinate
$content = array('chat_id' => $chat_id, 'latitude' => "37.5", 'longitude' => "15.1");
$telegram->sendLocation($content);
}
}