Answer the question
In order to leave comments, you need to log in
Telegram API not working, how to fix it?
I'm sending orders from the site to telegrams,
it doesn't work, the problem is due to blocking in the Russian Federation, the server seems to be located there.
$sendToTelegram = fopen("https://api.telegram.org/bot{$token}/sendMessage?chat_id={$chat_id}&parse_mode=html&text={$txt}","r");
$url = "https://api.telegram.org/bot{$token}/sendMessage?chat_id={$chat_id}&parse_mode=html&text={$txt}";
$ch = curl_init();
$proxy = "138.68.76.27:1080";
$optArray = array(
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_PROXY => "socks5://$proxy"
);
curl_setopt_array($ch, $optArray);
$result = curl_exec($ch);
echo json_encode(['status' => 'success']);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question