Willakuy ukhu
<?php // _______________________________/// // ÷÷÷÷÷÷÷ FAST CODER ÷÷÷÷÷÷÷÷ /// // ÷÷÷÷÷÷÷÷ PHP TEAM ÷÷÷÷÷÷÷÷ /// // ÷÷÷÷÷÷÷ @Fast_Coder ÷÷÷÷÷÷÷ /// // ÷÷÷ @Rustam_Hikmatullayev ÷÷÷ /// // ______________________________/// ob_start(); define('API_KEY','1218646174:AAFF_bfHkyimSk4BlbAQw7zDlR4ijdaV5_w'); $admin = "554834550"; function up($ch){ return bot('sendChatAction', [ 'chat_id' => $ch, 'action' => 'upload_photo', ]); } function ty($ch){ return bot('sendChatAction', [ 'chat_id' => $ch, 'action' => 'typing', ]); } 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; $mid = $message->message_id; $cid = $message->chat->id; $tx = $message->text; $photo_id=$message->photo[1]->file_id; $joy = file_get_contents("pechat/$cid.joy"); $step = file_get_contents("pechat/$cid.step"); $button = json_encode([ 'resize_keyboard'=>true, 'keyboard'=>[ [['text'=>"↖️"],['text'=>"⬆️"],['text'=>"↗️"],], [['text'=>"↙️"],['text'=>"⬇️"],['text'=>"↘️"],], ] ]); if($tx == "/start" or $tx == "/help"){ ty($cid); mkdir("pechat"); bot('sendMessage',[ 'chat_id'=>$cid, 'text'=>"😊**Salom**, men sizga suratlarga o'z pechatingizni qo'yishizga yordam beraman. Buning uchun oldin sozlab oling...\nIltimos o'z pechat logotipizni fayl ko'rinishida yuboring, rasm emas fayl ko'rinishida!", 'parse_mode'=>'markdown', ]); file_put_contents("pechat/$cid.step", "logo"); $baza = file_get_contents("pechat.dat"); if(mb_stripos($baza, $cid) !== false){ }else{ file_put_contents("pechat.dat", "$baza\n$cid"); } } $doc=$message->document; $doc_id=$doc->file_id; if(isset($message->document) and $step == "logo"){ ty($cid); $url = json_decode(file_get_contents('https://api.telegram.org/bot'.API_KEY.'/getFile?file_id='.$doc_id),true); $path=$url['result']['file_path']; $file = 'https://api.telegram.org/file/bot'.API_KEY.'/'.$path; $type = strtolower(strrchr($file,'.')); $type=str_replace('.','',$type); $okey = file_put_contents("pechat/$cid.ph.$type",file_get_contents($file)); if($okey){ file_put_contents("pechat/$cid.step", "joy"); bot('sendmessage',[ 'chat_id'=>$cid, 'text'=>"**Fayl** yuklab olindi. Endi logotip joylashuvini tanlang.", 'parse_mode'=>'markdown', 'reply_markup'=>$button, ]); }else{ bot('sendmessage',[ 'chat_id'=>$cid, 'text'=>"Xatolik #1. Iltimos shu xabarni @UzbekGuy'ga yuboring!", ]); } } if($step == "joy"){ if($tx == "Ortga"){ }else{ ty($cid); $tx = str_replace("↖️","1",$tx); $tx = str_replace("⬆️","2",$tx); $tx = str_replace("↗️","3",$tx); $tx = str_replace("↙️","4",$tx); $tx = str_replace("⬇️","5",$tx); $tx = str_replace("↘️","6",$tx); file_put_contents("pechat/$cid.joy", $tx); bot('sendmessage',[ 'chat_id'=>$cid, 'text'=>"👍Endi bemalol rasmlarni yuborishni boshlashingiz mumkin!", 'parse_mode'=>'markdown', ]); unlink("pechat/$cid.step"); } } if(isset($message->photo) and $joy){ $url = json_decode(file_get_contents('https://api.telegram.org/bot'.API_KEY.'/getFile?file_id='.$photo_id),true); $path=$url['result']['file_path']; $file = 'https://api.telegram.org/file/bot'.API_KEY.'/'.$path; $okey = file_put_contents("pechat/$cid.pic.png",file_get_contents($file)); $type = strtolower(strrchr($file,'.')); $type=str_replace('.','',$type); if($okey){ if($type == "jpg") $image = imagecreatefromjpeg("pechat/$cid.pic.png"); else if($type == "png") $image = imagecreatefrompng("pechat/$cid.pic.png"); $image_width = imagesx($image); $image_height = imagesy($image); $get = glob("poster/$cid.ph.*"); $tyu= strtolower(strrchr($get[0],'.')); $tyu=str_replace('.','',$tyu); if($tyu == "jpg") $logo = imagecreatefromjpeg("pechat/$cid.ph.jpg"); else if($tyu == "png") $logo = imagecreatefrompng("pech