#Kanaldan chiqsa Jarima beruvchi kod
if($update){
$status=$update->chat_member->new_chat_member->status;
$name=$update->chat_member->new_chat_member->user->first_name;
$id=$update->chat_member->new_chat_member->user->id;
if($status=="left"){
$refid=file_get_contents("referal/$id.txt");
$result = mysqli_query($db,"SELECT * FROM users WHERE user_id = '$refid'");
$row = mysqli_fetch_assoc($result);
$balansi=$row['balans'];
$bb=$balansi-$refpul;
mysqli_query($db, "UPDATE users SET balans='$bb' WHERE user_id='$refid'");
bot('sendMessage',[
'chat_id'=>$refid,
'text'=>"👤Sizni
$name Do'stingiz kanallarimizdan chiqib ketgani uchun sizga $refpul so'm jarima berildi!
Siz taklif qilgan odamlar kanaldan chiqib ketmasligini ta'minlang!",
'parse_mode'=>'html',
]);
bot("sendMessage",[
"chat_id"=>$id,
"text"=>"
Siz kanaldan chiqib ketdingiz qayta Obuna bo'ling!",
"parse_mode"=>"html",
"reply_markup"=>json_encode([
"inline_keyboard"=>[
[["text"=>"➕Obuna Bo'lish","url"=>"
https://t.me/loyihalarimuz"],],
[["text"=>"✅A'zo bo'ldim","callback_data"=>"check"],],
]
]),
]);
}
}
#Webhook qilish usuli
echo file_get_contents('