$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"https://yourdomain.ru/tlgrmurl/");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "postvar1=value1&postvar2=value2&postvar3=value3");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec ($ch);
curl_close ($ch);
https://api.telegram.org/bot312211243:AAF9H1vj3gmX1qGuIk2EHq3FQFBqPeR2GdE/setwebhook?url=https://domain.ru/tlgrmaddr/
https://yourdomain.ru/tlgrm/index.php
в котором у вас:<?
$content = file_get_contents('php://input');
// сохраните $content в файл или отправьте себе на почту
$content = file_get_contents('php://input'); // получаете данные от Telegram
$update = json_decode($content, TRUE);
$ch = curl_init($api_url . $method); // $method = /sendMessage или другой метод
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); // $params - все данные для отпарвки
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$result = curl_exec($ch);
curl_close($ch);
https://yourdomain.ru/some/tlgrm_bot_url/
и дальше используете webhook: https://api.telegram.org/bot[ВАШ_ТОКЕН]/setwebhook?url=[https://yourdomain.ru/some/tlgrm_bot_url/]
$botToken = 'ваш_token';
$website = 'https://api.telegram.org/bot' . $botToken;
$content = file_get_contents('php://input'); // получаете данные от Telegram
$update = json_decode($content, TRUE);
$message = $update['message'];
$chat_id = $message['chat']['id'];
$text = $message['text'];
// и дальше получаете другие параметры, проверяете какая команда пришла в $text от telegram и в зависимости от этого формируете данные и отправляете данные обратно нужным методом.
Благодарю
А можно это в браузерной строке вбить?