$acc_id, ]); self::send($acc_id,'Ваш телеграм аккаунт закреплён за '.$emp[Emp::$EMAIL]); //self::send($acc_id,'Ваш телеграм аккаунт закреплён за '.$emp[Emp::$EMAIL]."\n".$r->query."\n".($r->res?1:0)); } //self::send($acc_id,'Твой код: '.$code); } file_put_contents($path,$update_id+1); file_put_contents(__DIR__.'/updates.txt',date('d.m.Y H:i:s')."\n".je($v,true)."\n\n",FILE_APPEND); } } } static function send($acc_id,$text){ //$url = 'https://api.telegram.org/bot'.self::$TELEGRAM_BOT_TOKEN.'/sendMessage?chat_id=-491226996&text='.urlencode($text); $url = 'https://api.telegram.org/bot' . self::BOT . '/sendMessage?chat_id=' . $acc_id . '&text=' . urlencode($text).'&parse_mode=Markdown'; $res = []; if ($curl = curl_init()) { curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); $out = curl_exec($curl); curl_close($curl); $res = json_decode($out); } file_put_contents(__DIR__.'/log.txt',date('d.m.Y H:i:s')."\n".je([ 'acc'=>$acc_id, 'text'=>$text, 'res'=>$res, ],true)."\n\n",FILE_APPEND); return [ 'out'=>$out, 'res'=>$res, ]; } }