webhook for your bot, point to an url in your server
https://core.telegram.org/bots/api#setwebhook
3. For each request, get the data and process the message
$data = file_get_contents("php://input");
$data = json_decode($data);
var_dump($data);
4. Send the response as a telegram message
$url = "https://api.telegram.org/bot{$token}/sendMessage?chat_id=$chat_id&text=" .
urlencode($message) . "&parse_mode=$parse_mode" .
($replyMarkup !== FALSE ? "&reply_markup=$replyMarkup" : "") .
($replyTo !== FALSE ? '&reply_to_message_id=' . $replyTo : "");
See https://core.telegram.org/bots
Nice👍
Обсуждают сегодня