public function setWebHook($url, $path_certificate = null)
{
if (empty($url)) {
throw new TelegramException('Hook url is empty!');
}
$result = Request::setWebhook($url, $path_certificate);
if (!$result->isOk()) {
throw new TelegramException('Webhook was not set! Error: ' . $result->getErrorCode() . ' ' . $result->getDescription());
}
return $result;
}