Gönderi içeriği
1.Eng avvalo, @Botfather orqali bot ochamiz va tokenni olvolamiz. 2.Endi PHP kodni yozishni boshlaymiz.Avval methodni va oʻzgaruvchilarni yozamiz. <?php ob_start(); $API_KEY = "token"; define('API_KEY',$API_KEY); function bot($method,$datas=[]){ $url = "https://api.telegram.org/bot".API_KEY."/".$method; $ch = curl_init(); curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_RETURNTRANSFER,true); curl_setopt($ch,CURLOPT_POSTFIELDS,$datas); $res = curl_exec($ch); if(curl_error($ch)){ var_dump(curl_error($ch)); }else{ return json_decode($res); } } $update = json_decode(file_get_contents('php://input')); $message = $update->message; $tx = $message->text; $cid = $message->chat->id; $ism = $message->from->first_name; $inline = $update->callback_query->data; $cid2 = $update->callback_query->message->chat->id; $reply = $message->reply_to_message->text; $rpl = json_encode([ 'resize_keyboard'=>false, 'force_reply'=>true, 'selective'=>true ]); mkdir("matn");