Answer the question
In order to leave comments, you need to log in
Will this script work as it should?
Will this script work in such a way that it sends a message to the telegram chat with the bot and notifies about the entrance to the site / transition to the link? And if so, how to connect it to the site so that it functions?
$BOT_TOOKEN = '-------------token from bot father ------------';
$to = тид получателя;
$message = 'that you need ';
$parameters = array('chat_id' => $to, 'parse_mode' => 'HTML', "text" => $message);
$url = "https://api.telegram.org/bot" . trim($BOT_TOOKEN) . '/sendMessage?' . http_build_query($parameters);
$handle = curl_init($url);
curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
curl_setopt($handle, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($handle, CURLOPT_TIMEOUT, 60);
$response = curl_exec($handle);
Answer the question
In order to leave comments, you need to log in
will this script work so that it sends a message to a telegram chat with a bot
And if so, how to connect it to the site so that it would function
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question