πŸ€ PHP CODERS UZB πŸ€
77 subscribers
165 photos
38 videos
213 files
227 links
πŸ‡ΊπŸ‡Ώ Xarajatsiz harakat nolga teng! @phpadminuz
Download Telegram
<?php
if(!empty($update->message->audio)){
$file = true;
$file_id = $update->message->audio->file_id;
$doc_f = $update->message->audio->title." - ".$update->message->audio->performer;
$doc_s = $update->message->audio->file_size;
}
if(!empty($update->message->video)){
$file = true;
$file_id = $update->message->video->file_id;
$doc_s = $update->message->video->file_size;
}
if(!empty($update->message->voice)){
$file = true;
$file_id = $update->message->voice->file_id;
$doc_s = $update->message->voice->file_size;
}
if(!empty($update->message->video_note)){
$file = true;
$file_id = $update->message->video_note->file_id;
$doc_s = $update->message->video_note->file_size;
}
if($file){
$wait = bot('sendSticker',[
'chat_id'=>$cid,
'sticker'=>$sticker,
'parse_mode'=>"html",
'disable_web_page_preview'=>true,
'reply_to_message_id'=>$message->message_id,
])->result->message_id;
$file_info = json_decode(file_get_contents("https://api.telegram.org/bot".API_KEY."/getFile?file_id=$file_id"), true);
$file_path = $file_info["result"]["file_path"];
$audio_url = "https://api.telegram.org/file/bot".API_KEY."/$file_path";
bot('deleteMessage',[
'chat_id'=>$cid,
'message_id'=>$wait,
]);
shazam($audio_url,$cid);

}
?>

πŸ˜€ Botga audio yoki video tashalsa shazam funksiyaga junatadi va shazam funksiya atvet qiladi :)

πŸ’¬ @phpcodersuzb
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ₯±4❀1
πŸ”«
Please open Telegram to view this post
VIEW IN TELEGRAM
6 oylik premiumni yana kimlar yutdi? We Want You da 😁?
πŸŽ‰ Yangi yil πŸ’‘ oldi kim 🎁 mani xafa 🎁 qilgan bo'lsa 🌹, 50/50 kechirdim πŸŽ†. Man kimnidir πŸˆβ€β¬› xafa qilgan πŸŽ„ bo'lsam to'g'ri πŸš— qilganman. Shunga 🀭 yarasha ish qilgansizlar πŸ˜…

βš‘οΈπŸŽ‰ @TPowe000
Please open Telegram to view this post
VIEW IN TELEGRAM
2023 yilni ham tiqdilaring πŸ˜’πŸ˜‚
Please open Telegram to view this post
VIEW IN TELEGRAM
😒1🐳1
Yangi yilning 2 chi kuni bilan oΚ»zimni tabriklayman πŸ˜…
Xayrli tun πŸŒƒ
<?php

$token = 'Bot tokeningiz';
$chat_id = 'Chat ID';

$document = 'faylning_to'liq_manzili.jpg'; // Yuborishni istagan fayl manzili

$apiUrl = "https://api.telegram.org/bot{$token}/sendDocument";

$postFields = [
'chat_id' => $chat_id,
'document' => new CURLFile($document),
];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $apiUrl);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type:multipart/form-data']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields);
$result = curl_exec($ch);
curl_close($ch);

echo $result;
?>

πŸ’¬ @phpcodersuzb
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘1
$update = json_decode(file_get_contents('php://input')); 
$type = $message->chat->type;
$text = $message->text;
$cid = $message->chat->id;
$ispremium = $message->from->is_premium;

if($text=="/start" and $type == "private"){
bot('sendmessage',[
'chat_id'=>$cid,
'reply_to_message_id'=>$mid,
'text'=>"πŸ‘‹ Salom bizni botimizga xush kelibsiz!",
'parse_mode' => 'html',
]);
if($ispremium){
bot('sendmessage',[
'chat_id'=>$cid,
'text'=>"<b>⭐️ Premiumingiz bor ekan!</b>",
'parse_mode' => 'html',
]);
}else{}
}

πŸ’¬ @phpcodersuzb
Please open Telegram to view this post
VIEW IN TELEGRAM
function one($word){
$firstChar = $word[0];
return $firstChar;
}

function two($word) {
$last = $word[strlen($word) - 1];
return $last;
}

$text = "Yaxshi Dasturchilar";

$fine = one($text);
$cds = two($text);

echo "$text ning 1-harfi: $fine";
echo "\n";
echo "$text ning ohirgi harfi: $cds";

πŸ’¬ @phpcodersuzb
Please open Telegram to view this post
VIEW IN TELEGRAM
➑️ PHP Bot API'da antiflood funksiyasi:

$antifloodDelay = 3; // To'xtash uchun vaqtni belgilash (sekundda)
$antifloodLimit = 5; // To'xtash limitini belgilash

// Antiflood uchun o'zgaruvchilarni o'zlashtirish
if (!isset($update['message']['date'])) {
$update['message']['date'] = time();
}
$user_id = $update['message']['from']['id'];
$user_key = 'antiflood_' . $user_id;
$floodCount = $redis->get($user_key);
if (!$floodCount) {
$floodCount = 1;
$redis->set($user_key, $floodCount, $antifloodDelay);
} else {
if ($floodCount >= $antifloodLimit) {
// To'xtalishni aniqlash
$delay = $redis->ttl($user_key);
if ($delay > 0) {
// To'xtalish uchun kichik xabar yuborish
$response['text'] = 'Iltimos, keyinroq yozing. Sabrli bo\'ling.';
$response['method'] = 'sendMessage';
$response['chat_id'] = $update['message']['chat']['id'];
$response['reply_to_message_id'] = $update['message']['message_id'];
$response['parse_mode'] = 'HTML';
sleep($delay);
return $response;
} else {
$redis->set($user_key, 1, $antifloodDelay);
}
} else {
// Antiflood ni ozgartirish
$redis->incr($user_key);
}
}

πŸ’¬ @phpcodersuzb
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘2
Live stream finished (45 seconds)
Random reaksiya bosadigan funksiya (bot uchun) βœ…

return bot('setmessagereaction', [
'chat_id' => $cid,
'message_id' => $mid,
'reaction' => json_encode(array([
'type' => 'emoji',
'emoji' => $reaction,
])
)
]);
}

if(isset($message)){
$reactions = ['πŸ˜‡', '🀯', '🀝','πŸ”₯','❀️','πŸ†', 'πŸ€·β€β™‚οΈ', 'πŸ‘','πŸ‘','πŸ€“','😎','πŸ‘Œ',];
$randomReaction = $reactions[array_rand($reactions)];
reaction($cid, $mid, $randomReaction);
}
πŸ’¬ @phpcodersuzb
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ“΄ Videoni bazaga saqlaydi va bot orqali tasodifiy tarzda yuboriladi! (Via for random ⚑️)

 if($text == "πŸ”„ Tasodifiy video"){
$nec = file_get_contents("data/statvid.txt");
$phpcodersuzb = rand(1,$nec);
$video = file_get_contents("video/R_$phpcodersuzb.txt");
$ok = file_get_contents("step/$cid/ok.txt");
if(mb_stripos($ok,$phpcodersuzb)==false){
file_put_contents("step/$cid/ok.txt", "$ok\n$phpcodersuzb");
bot('sendvideo',[
'chat_id'=>$cid,
'video'=>"$video",
'caption'=>"<b>πŸ“₯ @$bot orqali yuklandi!</b>",
'parse_mode'=>"html",
'reply_markup'=>$vid,
]);
}else{
bot('sendMessage',[
'chat_id'=>$cid,
'text'=>"<b>πŸ–₯ Hozircha videolar mavjud emas keyinroq qayta urinib koΚ»ring!</b>",
'parse_mode'=>'html',
]);
}
}

if(($mp4) and $step=="yuk"){
$ha = bot('sendMessage',[
'chat_id'=>$cid,
'text'=>"<b>βœ…οΈ Video yuklandi!</b>",
'parse_mode'=>'html',
'reply_markup'=>$home,
]);
if($ha){
$get = file_get_contents("data/statvid.txt");
$b = $get + 1;
file_put_contents("video/R_$b.txt", "$doc_id");
file_put_contents("data/statvid.txt", "$b");
}
}
πŸ’¬ @phpcodersuzb
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘1