Biznes ChatBot orqali akauntga soat qo'yish kodi
Funksiya
Ko'payib ketgan rasmlarni keyinchalik o'chirish uchun
Qo'shimcha ma'lumot: ChatBot ulangan akauntni business_id sini olib cron qilsangiz akaunt nomini, biosini, glavni rasmini o'zgartirib turadi. Tepadagi kodda ishlatilingan rasm va font t.me/vip_kodlar_chat/2596
🚀 Namuna: @yetdi
©️ Manba: @vip_kodlar
🐶 Dasturchi: @Asilbek_Coder
Funksiya
bot();
date_default_timezone_set('Asia/Tashkent');
$time = date('H:i');
$img = imagecreatefromjpeg('img/rasm.jpg');
$font = "font/Font.ttf";
$color = imagecolorallocate($img, 255, 255, 255);
imagettftext($img, 50, -25, 400, 450, $color, $font, $time);
imagejpeg($img, "img/goto.jpg");
imagedestroy($img);
$filename = 'img/goto.jpg';
$photoFile = new CURLFile(realpath($filename));
$attachName = 'photo_file';
bot('setBusinessAccountName',[
'business_connection_id'=>"hviGADzo6EscDQAAWhRhLMUyBNQ",
'first_name' => "Telegramium | $time",
]);
bot('setBusinessAccountBio',[
'business_connection_id'=>"hviGADzo6EscDQAAWhRhLMUyBNQ",
'bio' => "@TgramUz | $time",
]);
$response = bot('setBusinessAccountProfilePhoto',[
'business_connection_id' => 'hviGADzo6EscDQAAWhRhLMUyBNQ',
'photo' => json_encode([
'type' => 'static',
'photo' => "attach://$attachName"
]),
$attachName => $photoFile,
'is_public' => false
]);
print_r($response);Ko'payib ketgan rasmlarni keyinchalik o'chirish uchun
for($i=0; $i<=100; $i++){
bot('removeBusinessAccountProfilePhoto',[
'business_connection_id' => 'hviGADzo6EscDQAAWhRhLMUyBNQ',
'is_public' => false
]);
}Qo'shimcha ma'lumot: ChatBot ulangan akauntni business_id sini olib cron qilsangiz akaunt nomini, biosini, glavni rasmini o'zgartirib turadi. Tepadagi kodda ishlatilingan rasm va font t.me/vip_kodlar_chat/2596
Please open Telegram to view this post
VIEW IN TELEGRAM
1 7 5 3 3
bot('giftPremiumSubscription',[
'user_id'=>$from_id, // foydalanuvchi id
'month_count'=>3, // 3, 6 va 12 oylik
'star_count'=>1000, // telegram stars
'text'=>"Foydalanuvchiga Premium sovg'a" // text
]);3 oylik
6 oylik
12 oylik
Qo'shimcha malumot: Starslar bot hisobidan ketadi
Please open Telegram to view this post
VIEW IN TELEGRAM
1 7 4 3
Funksiya
bot();
$photo = $message->photo;
$photo_file_id = $photo[sizeof($photo)-1]->file_id;
$photo_file_size = $photo[sizeof($photo)-1]->file_size;
mkdir("story");
if(!empty($photo)){
if($photo_file_size < 20000000){
$response = bot('getFile', ['file_id' => $photo_file_id]);
$file_path = $response->result->file_path;
mkdir("story/$chat_id");
$img = imagecreatefromstring(file_get_contents("https://api.telegram.org/file/bot" . API_KEY . "/$file_path"));
$w = imagesx($img); $h = imagesy($img); $tw = 1080; $th = 1920;
$ratio = min($tw/$w, $th/$h); $nw = $w*$ratio; $nh = $h*$ratio;
$resized = imagecreatetruecolor($tw, $th);
imagefill($resized, 0, 0, imagecolorallocate($resized, 255, 255, 255));
imagecopyresampled($resized, $img, ($tw-$nw)/2, ($th-$nh)/2, 0, 0, $nw, $nh, $w, $h);
imagejpeg($resized, "story/$chat_id/img.jpg", 100);
imagedestroy($img); imagedestroy($resized);
$filename = "story/$chat_id/img.jpg";
$photoFile = new CURLFile(realpath($filename));
$attachName = 'photo_file';
$svaqti = 3600 * 48;
$response = bot('postStory',[
'business_connection_id' => "$biznesid",
'content' => json_encode([
'type' => 'photo',
'photo' => "attach://$attachName"
]),
$attachName => $photoFile,
'active_period' => $svaqti,
'caption' => "Test istorya: @vip_kodlar",
'parse_mode' => "html",
'post_to_chat_page' => true,
'protect_content' => false
]);
bot('sendPhoto',[
'chat_id'=>$chat_id,
'photo'=>"https://".$_SERVER['SERVER_NAME'].dirname($_SERVER['SCRIPT_NAME'])."/story/$chat_id/img.jpg?".time(),
'caption'=>"Istorya qo'yildi",
'parse_mode'=>"html",
]);
unlink($filename);
}else{
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>"💾 20Mb dan kam rasm yuklang❗️",
'parse_mode'=>"html",
]);
}
}
Qo'shimcha ma'lumot: Istalgan o'lchamdagi rasmlarni qo'yish mumkin rasm 1080x1920 ga mos kelmasa bo'sh joylari 255, 255, 255 yani oq rang bilan to'ldiriladi xohlasangiz boshqa ranglarni raqamini sinab ko'rishingiz mumkin
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
1 9 6 5 2
Telegram Chatbot bilan akkauntdagi gift va nft giftlarni chiqarish
Qo'shimcha ma'lumot: Bu ishlashu uchun siz Biznes Chatbot sozlamalaridan kerakli ruxsatlarni yoqib qo'yishingiz kerak rasmda ko'rsatilgan
🚀 Namuna: bu yerda
©️ Manba: @vip_kodlar
✅ Dasturchi: @DrLiviesey
if(isset($business_message) and $text==".gift" and $chat_id!=$from_id){
$get = json_decode(file_get_contents("https://api.telegram.org/bot$TOKEN/getBusinessAccountGifts?business_connection_id=$business_id"),true);
$i=1;
foreach($get['result']['gifts'] as $nums){
if($nums['type']=="unique"){
$base_name = $nums['gift']['base_name'];
$name = $nums['gift']['name'];
$inline[]=["text"=>"$i. $base_name","url"=>"https://t.me/nft/$name"];
$inlinekeys=array_chunk($inline, 1);
$inline_keyboard=json_encode([
'inline_keyboard'=>$inlinekeys,
]);
$i++;
}
}
$i = $i - 1;
$allgift = $get['result']['total_count'];
bot('editmessagetext',[
'business_connection_id'=>$business_id,
'chat_id'=>$chat_id,
'message_id'=>$message_id,
'parse_mode'=>'html',
'text'=>"<tg-emoji emoji-id='5199749070830197566'>🎁</tg-emoji> Jami sovg'alar: <b>$allgift</b> ta\n<tg-emoji emoji-id='5407118600211293224'>🧢</tg-emoji> NFT sovg'alar: <b>$i</b> ta",
'reply_markup'=>$inline_keyboard
]);
exit();
}Qo'shimcha ma'lumot: Bu ishlashu uchun siz Biznes Chatbot sozlamalaridan kerakli ruxsatlarni yoqib qo'yishingiz kerak rasmda ko'rsatilgan
Please open Telegram to view this post
VIEW IN TELEGRAM
2 4 3 3👍1
bot();
$message = $update->message;
$chat_id = $message->chat->id;
$message_id = $message->message_id;
$message_tid = $message->message_thread_id;
$date = $message->date;
mkdir("kanal");
$from_id = $message->from->id;
$sender_type = $message->sender_chat->type;
$sender_id = $message->sender_chat->id;
$fomid = $message->forward_origin->message_id;
$rfrom_id = $message->reply_to_message->from->id;
$rsender_type = $message->reply_to_message->sender_chat->type;
$rsender_id = $message->reply_to_message->sender_chat->id;
$rfomid = $message->reply_to_message->forward_origin->message_id;
$channel = $update->channel_post;
$channel_mid = $channel->message_id;
$channel_date = $channel->date;
$channel_id = $channel->chat->id;
if($channel){
$muhokamaid = bot('getchat', ['chat_id' => $channel_id])->result->linked_chat_id;
$muhokama = explode("-100", $muhokamaid)[1];
$inline = [
'inline_keyboard' => [
[['text' => "👨💻 Admin", 'url' => "tg://user?id=5819317484"]],
[['text' => "💬 Comment 🕒", 'url' => "https://t.me/c/$muhokama/$channel_date/?thread=1"]],
]
];
if(!$muhokamaid){
$inline['inline_keyboard'][1][0]['text'] = "Kanalga Comment guruh ulanmagan";
$inline['inline_keyboard'][1][0]['url'] = "https://t.me/vip_kodlar_chat";
}else{
$botid = explode(":", API_KEY)[0];
$stat = bot("getChatMember", [
"chat_id" => "$muhokamaid",
"user_id" => $botid,
])->result->status;
if($stat != "administrator"){
$inline['inline_keyboard'][1][0]['text'] = "Botni Comment guruhga admin qiling";
$inline['inline_keyboard'][1][0]['url'] = "https://t.me/vip_kodlar_chat";
}
}
bot('editMessageReplyMarkup', [
'chat_id' => $channel_id,
'message_id' => $channel_mid,
'reply_markup' => json_encode($inline)
]);
}
if($from_id == 777000 and $sender_type == "channel"){
file_put_contents("kanal/$sender_id-$fomid-$chat_id-$message_id.txt", 0);
$muhokama = explode("-100", $chat_id)[1];
$inline = [
'inline_keyboard' => [
[['text' => "👨💻 Admin", 'url' => "tg://user?id=5819317484"]],
[['text' => "💬 Fikr bildirish", 'url' => "https://t.me/c/$muhokama/$date/?thread=$message_id"]],
]
];
bot('editMessageReplyMarkup', [
'chat_id' => $sender_id,
'message_id' => $fomid,
'reply_markup' => json_encode($inline)
]);
}
if($rfrom_id == 777000 and $rsender_type == "channel" or isset($message_tid)){
if(isset($message_tid) and !isset($rfomid)){
$pattern = "kanal/*$chat_id-$message_tid.txt";
$matching_files = glob($pattern);
$fileu = $matching_files[0];
$nta = file_get_contents("$fileu");
$parts = explode('-', $fileu);
$rsender_id = "-".$parts[1];
$rfomid = $parts[2];
}else{
$nta = file_get_contents("kanal/$rsender_id-$rfomid-$chat_id-$message_tid.txt");
}
$nta += 1;
file_put_contents("kanal/$rsender_id-$rfomid-$chat_id-$message_tid.txt", $nta);
$muhokama = explode("-100", $chat_id)[1];
$inline = [
'inline_keyboard' => [
[['text' => "👨💻 Admin", 'url' => "tg://user?id=5819317484"]],
[['text' => "💬 $nta ta fikr", 'url' => "https://t.me/c/$muhokama/$date/?thread=$message_tid"]],
]
];
bot('editMessageReplyMarkup', [
'chat_id' => $rsender_id,
'message_id' => $rfomid,
'reply_markup' => json_encode($inline)
]);
}
Qo'shimcha ma'lumot: Bot kanalga ham guruhga ham admin bo'lishi kerak Comment ni Telegram akaunti guruhga tashlaydi shunga tugma 3+- soniya kechikishi mumkin
Please open Telegram to view this post
VIEW IN TELEGRAM
1 9 5 5👍2 2
Funksiya
bot();
function cdate($dd) {
$h = ['x-api-key: e758fb28-79be-4d1c-af6b-066633ded128'];
$d = ["telegramId" => (int)$dd];
$ch = curl_init('https://restore-access.indream.app/regdate');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $h);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($d));
$r = curl_exec($ch);
return json_decode($r)->data->date;
curl_close($ch);
}
if($text=="/infotg"){
$result=json_decode(file_get_contents("https://api.telegram.org/bot".API_KEY."/getUserProfilePhotos?user_id=$chat_id"),true);
$file_id = $result["result"]["photos"][0][0]["file_id"];
$count = $result["result"]["total_count"];
$sana = cdate($chat_id);
bot("sendphoto",[
"chat_id"=>$chat_id,
"photo"=>"$file_id",
"caption"=>"📅 Telegram akkauntingiz yaratilgan sana: $sana
👤 | Usernamingiz: @$username
🎫 | ID raqamingiz: $chat_id
📸 | Profil rasmlaringiz soni: $count 💐
➖ ",
'reply_to_message_id'=>$message_id,
]);
}Qoʻshimcha maʼlumot: cdate(); funksiyasini ichidagi apidan istalgan akauntni tg idsi orqali qachon ochilganini koʻrish mumkin
Please open Telegram to view this post
VIEW IN TELEGRAM
1 10 5 4👍3🔥1
Bu vaqtda DNS tizimi qaysi sahifani qidiryapsiz, oldin kirganmisiz, xaker emasmisiz – shuni aniqlaydi. Agar AyTi, ayniqsa, kiberxavfsizlik yoki veb dasturlash sohasidan ketsangiz, shu jarayonni tushunish muhim.
Maqolamiz bunda yordam beradi. Unda DNS nimaligidan boshlab tizimga nisbatan hujumlardan himoyalanishgacha tushuntirilgan.
@mohirdev
Please open Telegram to view this post
VIEW IN TELEGRAM
1👍3 3
MadelineProto bilan user uchun kanalga qo'shilish va chiqish, kanal va guruh yaratish metodlari
Kanalga qo'shilish
Kanaldan chiqish
Kanal yaratish
Guruh yaratish
Qoʻshimcha maʼlumot: qo'shilish va chiqishda faqat username bo'lishi kerak degani emas unda oddiy link yoki id
©️ Manba: @vip_kodlar
✅ Dasturchi: @DrLiviesey
Kanalga qo'shilish
$this->channels->joinChannel([
'channel' => '@channelusername'
]);
Kanaldan chiqish
$this->channels->leaveChannel([
'channel' => '@channelusername'
]);
Kanal yaratish
$this->channels->createChannel([
'title' => 'test creat'
]);
Guruh yaratish
$this->messages->createChat([
'title' => 'test creat'
]);
Qoʻshimcha maʼlumot: qo'shilish va chiqishda faqat username bo'lishi kerak degani emas unda oddiy link yoki id
Please open Telegram to view this post
VIEW IN TELEGRAM
1 4👍3 3 2
Forwarded from Sardor Dushamov | PHP
Jakhongir Rakhmonov - IT
Eng zo’r kod bu to’g’ri ishni qilishni iloji boricha osonlashtiradigan va noto’g’ri ishni qilishni iloji boricha qiyinlashtiradigan koddir.
Shu jumlarni PHP kodlar yordamida tushuntirgim keldi:
Typesiz holat
Typesiz holat
<?php
function yigindi($a, $b) {
return $a + $b;
}
// Misol uchun:
echo yigindi(5, 7); // Natija: 12echo yigindi("5", 7); // Natija: 12
?>
Endi type bilan:
function yigindi(int $a, int $b): int {
return $a + $b;
}
// 1. To‘g‘ri qiymatlar:
echo yigindi(5, 10); // Natija: 15
// 2. Xato qiymatlar (katta ehtimol bilan PHP xatolik beradi):
// echo yigindi("5", 10); // string berilgan — TypeError
// echo yigindi(5.5, 2); // float berilgan — TypeError
// echo yigindi(true, false); // boolean berilgan — TypeError
// echo yigindi(null, 10); // null berilgan — TypeError
?>
Ustasiga farqi yo'q))1 8👍4🔥2 1
Forwarded from UzGeeks Community - 10 yoshda🎉
Assalom alaykum!!!
UzGeeksʼda DevOps kuni!
📌 31-may, shanba kuni TATU binosida "UzGeeks May2025 DevOps Day Meetup" boʻlib oʻtadi.
⭐️Meetupʼda quyidagi spikerlar ishtirok etadi:
🔄 Meetup odatiy ravishda bepul boʻlib, soat 14:00 da boshlanadi, unda qatnashish uchun UzGeeks.uz saytida roʻyxatdan oʻtish kerak.
📍Manzil: Amir Temur ko‘chasi, 108 (Toshkent axborot texnologilari universiteti)
🎙Hamkorlar:
➡️ Oʻzbekiston Respublikasi Raqamli texnologiyalar vazirligi;
➡️ Raqamli ta'limni rivojlantirish markazi;
➡️ Thinkland.
➡️ Toshkent axborot texnologilari universiteti
➡️ Floss O'zbekiston.
Sayt | Guruh | Kanal | Facebook | 💫 Donate
UzGeeksʼda DevOps kuni!
📌 31-may, shanba kuni TATU binosida "UzGeeks May2025 DevOps Day Meetup" boʻlib oʻtadi.
⭐️Meetupʼda quyidagi spikerlar ishtirok etadi:
1️⃣“GitOps Beyond Kubernetes: Applying GitOps to VMs, and more”
- Numon Amirov (Owner @ Subinc);
2️⃣“Lets Nix it.”
- Sokhibjon Orzikulov (Head of OSS @ Uzinfocom);
3️⃣“Katta infrastrukturani boshqarishda monitoringning o'rni.”
- Jahongir Yovmuddinov (Yetakchi mutahassis @ Mobiuz);
🔄 Meetup odatiy ravishda bepul boʻlib, soat 14:00 da boshlanadi, unda qatnashish uchun UzGeeks.uz saytida roʻyxatdan oʻtish kerak.
📍Manzil: Amir Temur ko‘chasi, 108 (Toshkent axborot texnologilari universiteti)
🎙Hamkorlar:
➡️ Oʻzbekiston Respublikasi Raqamli texnologiyalar vazirligi;
➡️ Raqamli ta'limni rivojlantirish markazi;
➡️ Thinkland.
➡️ Toshkent axborot texnologilari universiteti
➡️ Floss O'zbekiston.
Sayt | Guruh | Kanal | Facebook | 💫 Donate
1👍3🔥1 1 1
Forwarded from Web Dev Master UZ | IT Dasturlash | Frontend | Backend | React | Nodejs | Python | PHP | Javascript | Android | Java
Media is too big
VIEW IN TELEGRAM
Videodagi Loyihani toʻliq qismi 1000+ obunachi boʻsak joyliman! Obuna boʻling 🤝
👇👇👇💥🔥 Reaksiya gooo
👇👇👇💥🔥 Reaksiya gooo
1👍9 7 6 3 1
Livestrem qilaman ovoz boʻlmasligi mumkin savolingiz boʻlsa comment da yozing
1 8👍3 3 3 1
API
Funksiya
Qoʻshimcha maʼlumot: cdate();
Stadionuz saytidan xozirgi real vaqtdagi malumotni olib beradi
🚀 Namuna: t.me/Anowkabot
©️ Manba: @vip_kodlar
🐶 Dasturchi: @Boydadasi
$url = 'https://m.stadion.uz/news/rss';
$rss = simplexml_load_file($url);
foreach ($rss->channel->item as $item){
$line = $item->title;
$lifud = $item->link;
}
Funksiya
bot();
if($data=="fudboly"){
$soat = date('H:i', strtotime('2 hour'));
bot('DeleteMessage',[
'chat_id'=>$cid2,
'message_id'=>$mid2,
]);
bot('sendmessage',[
'chat_id'=>$cid2,
'message_id'=>$mid2,
'text'=> "<pre>Xozirgi ⏰ Soat: $vaqt bo'yicha \n</pre>\n🔔Eng so‘ngi 📰futbol yangiliklari
🆕️[$line]($lifud)
🍃Batafsil o‘qish uchun bosing
",
'show_alert'=>true,
'parse_mode' =>"html",
'reply_markup'=>json_encode(
['inline_keyboard' => [
[['text'=>'◀️','callback_data'=>'vertual']],
]
])
]);
}Qoʻshimcha maʼlumot: cdate();
Stadionuz saytidan xozirgi real vaqtdagi malumotni olib beradi
Please open Telegram to view this post
VIEW IN TELEGRAM
1👍5 4 3 2 1 1
This media is not supported in your browser
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
1🔥9 7 6 4👍1
Forwarded from Men, Adamov
#css_in_js
🤔 CSS-in-JS nima?
Bu — an'anaviy .css fayllari o'rniga JavaScript kodining o'zida CSS stillarini yozish imkonini beruvchi texnika. Stillar to'g'ridan-to'g'ri komponentlarga "bog'lanadi".
🤨 Qayerda ishlatiladi?
Asosan, React, Vue, Svelte kabi komponentlarga asoslangan freymvorklar bilan birga qo'llaniladi. Styled-components, Emotion, JSS kabi kutubxonalar bu yondashuvning eng mashhur namoyandalaridir.
🥸 Qiziqarli faktlar:
🚀
🚀
🚀
👉🏿 Men, Adamov 👈🏿
Bu — an'anaviy .css fayllari o'rniga JavaScript kodining o'zida CSS stillarini yozish imkonini beruvchi texnika. Stillar to'g'ridan-to'g'ri komponentlarga "bog'lanadi".
Asosan, React, Vue, Svelte kabi komponentlarga asoslangan freymvorklar bilan birga qo'llaniladi. Styled-components, Emotion, JSS kabi kutubxonalar bu yondashuvning eng mashhur namoyandalaridir.
Dinamiklikning cho'qqisi: Stillarni JavaScript o'zgaruvchilari (props, state) orqali boshqarish mumkin. Masalan, tugma bosilishiga qarab uning rangini bir zumda o'zgartirish!Global CSS'dan qochish: Bu usul "klasslar mojarosi" (class name collision) muammosini deyarli yo'qqa chiqaradi. Har bir stil faqat o'zi tegishli bo'lgan komponentga ta'sir qiladi."O'lik kod"ni avtomatik tozalash: Faqat ishlatilayotgan komponentlarning stillari sahifaga qo'shiladi. Agar biror komponentni o'chirsangiz, uning stillari ham avtomatik ravishda yo'qoladi. Kod ortiqcha "chiqindilar"dan tozalanadi!👉🏿 Men, Adamov 👈🏿
Please open Telegram to view this post
VIEW IN TELEGRAM
1 6 3 3 2🔥1
Assalomu alaykum va rohmatullohi va barokatuh❤️
Qurbon hayitingiz muborak boʻlsin🌹
Qurbon hayitingiz muborak boʻlsin
Please open Telegram to view this post
VIEW IN TELEGRAM
2 17 5 4 3 2