This media is not supported in your browser
VIEW IN TELEGRAM
SendMessage ga yoki boshqa send methodlarga reaksiyaga oʻxshagan effect qo'shish kodi
Funksiya
O'zgaruvchilar va kod
Qo'shimcha malumot: Yuqoridagi videoda faqat foydalanuvchi tanlagan effect_id ni olish koʻrsatilgan siz undan bitta yoqganini kodingizdagi /start xabariga yoki boshqasiga message_effect_id qoʻyib ishlatishingiz mumkin
🚀 Namuna: @ReaksiyalarBot
🇺🇿 Manba: @vip_kodlar
🐶 Dasturchi: @Asilbek_Coder
Funksiya
bot();
O'zgaruvchilar va kod
$effect_id = $message->effect_id;
if(isset($effect_id)){
bot('sendMessage',[
'chat_id'=>$cid,
'message_effect_id'=>"5046509860389126442",
'text'=>"effect_id: <code>$effect_id</code>",
'parse_mode'=>'html',
]);
}
Qo'shimcha malumot: Yuqoridagi videoda faqat foydalanuvchi tanlagan effect_id ni olish koʻrsatilgan siz undan bitta yoqganini kodingizdagi /start xabariga yoki boshqasiga message_effect_id qoʻyib ishlatishingiz mumkin
Please open Telegram to view this post
VIEW IN TELEGRAM
1 11 2 2
Kanaldagi postlarni 1-kanaldan 2-kanalga ko'chirish, bitta so'rov bilan 100 ta postni
Shuningdek forwardMessages shu postlarni forward qilish
va deleteMessages postlarni o'chirish
Qo'shimcha ma'lumot: Agar postlar ko'p bolsa bot bilan ishlatmang bot qotib qolishi mumkin get bilan qiling
🐶 Dasturchi: @DrLiviesey
🇺🇿 Manba: @vip_kodlar
<?php
$start = 1; // 1 chi postdan
$end = 600; // 600 chi postgacha
for ($i = $start; $i <= $end; $i += 100) {
$m = min($i + 99, $end);
$messageIds = range($i, $m);
bot('copyMessages',[
'chat_id'=>"Kanal_id", // qaysi kanalga yuborish
'from_chat_id'=>"Kanal_id", // qaysi kanaldan olish
'message_ids'=>json_encode($messageIds)
]);
sleep(3);
}
?>
Shuningdek forwardMessages shu postlarni forward qilish
bot('forwardMessages',[
'chat_id'=>"Kanal_id",
'from_chat_id'=>"Kanal_id",
'message_ids'=>json_encode($messageIds)
]);va deleteMessages postlarni o'chirish
bot('deleteMessages',[
'chat_id'=>"Kanal_id",
'message_ids'=>json_encode($messageIds)
]);Qo'shimcha ma'lumot: Agar postlar ko'p bolsa bot bilan ishlatmang bot qotib qolishi mumkin get bilan qiling
Please open Telegram to view this post
VIEW IN TELEGRAM
1 9 5 4
Forwarded from JavaScript
Pianino yasashni o'rganamiz 👀
Bu post aniq esingizda!
Yopiq kanalim uchun mo'ljallangan video darslikni sizlar bilan baham ko'ryapman
Foydalaning
LINK omonat: https://youtu.be/f367GFzD7-c
@abs_javascript |🔥
Bu post aniq esingizda!
Yopiq kanalim uchun mo'ljallangan video darslikni sizlar bilan baham ko'ryapman
Navro'z muborak)
LINK omonat: https://youtu.be/f367GFzD7-c
@abs_javascript |
Please open Telegram to view this post
VIEW IN TELEGRAM
1 6 3 3👍2
Webapp urldan webappni o'ziga matnli so'rov yuborish kodi
Qo'shimcha ma'lumot: Php fayl ga html css kod bor o'rtasiga php kod yozilgan webapp dagi textni html o'rtasiga chiqaradi.
Webapp ga qisqa url qo'shish qo'llanmasi: https://t.me/vip_kodlar_chat/1486
🚀 Namuna: t.me/isoatbot/matn?startapp=text
🇺🇿 Manba: @VIP_KODLAR
🐶 Dasturchi: @Asilbek_Coder
<!DOCTYPE html>
<html lang="uz">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Asilbek Coder</title>
</head>
<body>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: sans-serif;
}
body {
background: #07252d;
}
.box {
position: relative;
width: 90%;
margin: auto;
margin-top: 150px;
}
.box h1 {
width: 100%;
text-align: center;
color: #0e3742;
}
.box h1 span {
width: 100%;
font-size: 90px;
}
h1 span {
animation: animate 6s linear infinite;
transition: .4s;
}
h1 span:nth-child(even) {
animation-delay: .5s;
}
@keyframes animate {
0%,8%,18%,20%,50.1%,60%,65.1%,80%,90.1%,92% {
color: #0e3742;
text-shadow: none;
}
8.1%,18.1%,20.1%,50%,30%,60.1%,65%,80.1%,90%,92.1%,100% {
color: #fff;
text-shadow: 0 0 10px #03bcf4,
0 0 20px #03bcf4,
0 0 40px #03bcf4,
0 0 80px #03bcf4,
0 0 160px #03bcf4,
0 0 400px #03bcf4;
}
}
</style>
<div class="box">
<h1>
<?php
$text = $_GET['tgWebAppStartParam'];
if ($text == '') {
$text = "@Asilbek_Coder";
}
for ($i = 0; $i < strlen($text); $i++) {
$text2 = $text[$i];
echo "<span>$text2</span>";
}
?>
</h1>
</div>
</body>
</html>
Qo'shimcha ma'lumot: Php fayl ga html css kod bor o'rtasiga php kod yozilgan webapp dagi textni html o'rtasiga chiqaradi.
Webapp ga qisqa url qo'shish qo'llanmasi: https://t.me/vip_kodlar_chat/1486
Please open Telegram to view this post
VIEW IN TELEGRAM
1 5 4 2
Bot yuborgan xabar matnini har xil uslubda tahrirlash kodi
Funksiya
O'zgaruvchilar va kod
Qo'shimcha malumot: 1 yarim yil oldin yozgan kodim GPT api dan kelgan javob matnini inline tugmalar bilan tahrirlash va o'sha bosilgan tugmaga ✅ qo'shish oldin bu kod juda uzun edi hozir ancha qisqartirdim
🚀 Namuna: @Suniy_intelekt_bot
🇺🇿 Manba: @vip_kodlar
🐶 Dasturchi: @Asilbek_Coder
Funksiya
bot();
O'zgaruvchilar va kod
$text = $message->text;
$chat_id = $message->chat->id;
$mid = $message->message_id;
mkdir("step");
$data = $callback->data;
$chat_id2 = $callback->message->chat->id;
$mid2 = $callback->message->message_id;
if($text != "/start"){
$echo = file_get_contents("https://api.smtv.uz/ai/index.php?text=".urlencode($text));
$datay = json_decode($echo, true);
$javob = $datay['answer'];
if($javob == ""){
$javob = "API ishlamayapti";
}
file_put_contents("step/j$chat_id.txt", "$javob");
bot('sendMessage', [
'chat_id' => $chat_id,
'text' => "$javob",
'reply_to_message_id'=>$mid,
'parse_mode' => "html",
'reply_markup'=>json_encode([
'inline_keyboard'=>[
[['text'=>"📝 Matnni Tahrirlash",'callback_data'=>"t==tahrir"]],
],
])
]);
}
$inline = [
'inline_keyboard' => [
[['text' => "Qiya", 'callback_data' => "t==qiya"], ['text' => "Qalin", 'callback_data' => "t==qalin"], ['text' => "Spoiler", 'callback_data' => "t==spoiler"], ['text' => "Katta", 'callback_data' => "t==katta"]],
[['text' => "Kichik", 'callback_data' => "t==kichik"], ['text' => "Teskari", 'callback_data' => "t==teskari"], ['text' => "Tagchiziq", 'callback_data' => "t==tagchiziq"], ['text' => "Audio", 'callback_data' => "t==jaudio"]],
]
];
if(preg_match("/t==/i", $data)){
$pt = " ✅";
$ex = explode("t==", $data)[1];
$jstep = file_get_contents("step/j$chat_id2.txt");
if ($ex == "qiya") {
$inline['inline_keyboard'][0][0]['text'] .= $pt;
$text2 = "<i>$jstep</i>";
}else if ($ex == "qalin") {
$inline['inline_keyboard'][0][1]['text'] .= $pt;
$text2 = "<b>$jstep</b>";
}else if ($ex == "spoiler") {
$inline['inline_keyboard'][0][2]['text'] .= $pt;
$text2 = "<tg-spoiler>$jstep</tg-spoiler>";
}else if ($ex == "katta") {
$inline['inline_keyboard'][0][3]['text'] .= $pt;
$text2 = strtoupper($jstep);
}else if ($ex == "kichik") {
$inline['inline_keyboard'][1][0]['text'] .= $pt;
$text2 = strtolower($jstep);
}else if ($ex == "teskari") {
$inline['inline_keyboard'][1][1]['text'] .= $pt;
$text2 = strrev($jstep);
}else if ($ex == "tagchiziq") {
$inline['inline_keyboard'][1][2]['text'] .= $pt;
$text2 = "<u>$jstep</u>";
}else if ($ex == "jaudio") {
$jstep2 = urlencode($jstep);
bot('sendVoice', [
'chat_id' => $chat_id2,
'reply_to_message_id' => $mid2,
'voice' => "https://translate.google.com/translate_tts?ie=UTF-8&client=tw-ob&tl=ar&q=$jstep2",
'caption' => "",
'parse_mode' => 'html',
]);
}else{
$text2 = $jstep;
}
bot('editMessageText', [
'chat_id' => $chat_id2,
'message_id' => $mid2,
'text' => "$text2",
'parse_mode' => "html",
'reply_markup' => json_encode($inline)
]);
}
Qo'shimcha malumot: 1 yarim yil oldin yozgan kodim GPT api dan kelgan javob matnini inline tugmalar bilan tahrirlash va o'sha bosilgan tugmaga ✅ qo'shish oldin bu kod juda uzun edi hozir ancha qisqartirdim
Please open Telegram to view this post
VIEW IN TELEGRAM
1 17👍2 2 2
Forwarded from Web Dasturlash kanali
This media is not supported in your browser
VIEW IN TELEGRAM
Kiber hayot 😅
1 2
Forwarded from Telegram Contests
The judges have completed the evaluation of all submissions.
The Main Task – reworking the text editor – proved to be quite challenging for the majority of contestants.
We’ve decided to expand the scope of this contest. Final scoring is currently underway, and we will announce the results on April 8, 2025, along with the details for Round 2.
Please open Telegram to view this post
VIEW IN TELEGRAM
1 2
Rasm ustiga rasm joylash
Qo'shimcha malumot: Bu bilan soxta hujjat qilsangiz bo'ladi👹
Lekin ehtiyot bo'ling! soxta hujjat tayyorlash deb olib ketishmasin❗️
🇺🇿 Manba: @vip_kodlar
🐶 Dasturchi: chatgpt
<?php
// Asosiy rasmni yuklash
$background = imagecreatefromjpeg('background.jpg');
// Ustiga qo'yiladigan rasmni yuklash (PNG formatda bo'lsa shaffoflikni saqlaydi)
$overlay = imagecreatefrompng('overlay.png');
// Overlay rasm o'lchamini olish
$overlay_width = imagesx($overlay);
$overlay_height = imagesy($overlay);
// Overlay rasmni joylash joyi (markazga qo'yish)
$bg_width = imagesx($background);
$bg_height = imagesy($background);
$x = ($bg_width - $overlay_width) / 2;
$y = ($bg_height - $overlay_height) / 2;
// Ikkala rasmni birlashtirish
imagecopy($background, $overlay, $x, $y, 0, 0, $overlay_width, $overlay_height);
// Natijani saqlash
imagejpeg($background, 'output.jpg', 100);
// Xotirani tozalash
imagedestroy($background);
imagedestroy($overlay);
echo "Rasm muvaffaqiyatli yaratildi!";
?>
Qo'shimcha malumot: Bu bilan soxta hujjat qilsangiz bo'ladi
Lekin ehtiyot bo'ling! soxta hujjat tayyorlash deb olib ketishmasin
Please open Telegram to view this post
VIEW IN TELEGRAM
1 7 5👍3 3
Chatbot orqali profilingizdagi emoji status yani nomingiz oʻng tarafidagi nishon ni oʻzgartirish kodi
Funksiya
Oʻzgaruvchilar va kod
Buni ishlatish uchun webappdan requestEmojiStatusAccess ni yoqish kerak shuni yoqadigan kod pastda👇
Framework
Qo'shimcha ma'lumot: Profilingiz ga kirmasdan Botda yoki istalgan chatda emoji statusingizni o'zgartirsangiz bo'ladi + cron bilan har soatda yoki har minutda o'zgartiradigan qilish mumkin. t.me/vip_kodlar_chat/1678?single
🚀 Namuna: @MilliyChatBot
🇺🇿 Manba: @vip_kodlar
🐶 Dasturchi: @Asilbek_Coder
Funksiya
bot();
Oʻzgaruvchilar va kod
$bmessage_emojitext = $bmessage->entities;
$bmessage_emojitexte = $bmessage->entities[0]->custom_emoji_id;
if(isset($bmessage_emojitext) and preg_match("/.status/i", $bmessage_text)){
$emoji = json_encode($bmessage_emojitext);
bot('setUserEmojiStatus',[
'user_id'=>$bmessage_fid,
'emoji_status_custom_emoji_id' => $bmessage_emojitexte,
]);
bot('editMessagetext',[
'business_connection_id'=>$bmessage_id,
'chat_id'=>$bmessage_cid,
'message_id' => $bmessage_mid,
'text'=>"$bmessage_text statusingizga qo'yildi",
'entities'=>"$emoji",
]);
}
Buni ishlatish uchun webappdan requestEmojiStatusAccess ni yoqish kerak shuni yoqadigan kod pastda👇
Framework
<script src="https://telegram.org/js/telegram-web-app.js?56"></script>
let tg = window.Telegram.WebApp;
tg.expand();
tg.requestEmojiStatusAccess();
Qo'shimcha ma'lumot: Profilingiz ga kirmasdan Botda yoki istalgan chatda emoji statusingizni o'zgartirsangiz bo'ladi + cron bilan har soatda yoki har minutda o'zgartiradigan qilish mumkin. t.me/vip_kodlar_chat/1678?single
Please open Telegram to view this post
VIEW IN TELEGRAM
1 8 3 2👍1🔥1
VIP KODLAR
Chatbot orqali profilingizdagi emoji status yani nomingiz oʻng tarafidagi nishon ni oʻzgartirish kodi Funksiya bot(); Oʻzgaruvchilar va kod $bmessage_emojitext = $bmessage->entities; $bmessage_emojitexte = $bmessage->entities[0]->custom_emoji_id; if(is…
Frontend Backend kodlarni oʻzingiz yozganingiz uchun bemalol birlashtira olasiz
Frontend ga alohida Backend ga alohida dasturchi boʻlsa bir birini tushunmasligi mumkin
Please open Telegram to view this post
VIEW IN TELEGRAM
1👍8🔥3 3 2
Bot nomini har xil tillarga o'zgaradigan qilish. Bu boshqa davlatdan botingizga kiradiganlar uchun qulay boʻlishi mumkin
Funksiya
Qo'shimcha ma'lumot: Telegramdagi tilni o'zgartirsangiz bot nomi o'zgaradi bazi tillarda o'zgarmasligi mumkin asosiysi uz, en, ru qilganingiz maqul. Keyin bu so'rovni bir marta ishlatish kerak bo'lmasa keyin bot nomini oʻzgartirolmasligingiz mumkin
🚀 Namuna: @MilliyChatBot
🇺🇿 Manba: @vip_kodlar
🐶 Dasturchi: @Asilbek_Coder
Funksiya
bot();
bot('setMyName',[
'name'=>"Milliy Chat Bot",
'language_code' => "uz",
]);
bot('setMyName',[
'name'=>"National Chat Bot",
'language_code' => "en",
]);
bot('setMyName',[
'name'=>"Национальный чат-бот",
'language_code' => "ru",
]);
bot('setMyName',[
'name'=>"روبوت الدردشة الوطني",
'language_code' => "ar",
]);Qo'shimcha ma'lumot: Telegramdagi tilni o'zgartirsangiz bot nomi o'zgaradi bazi tillarda o'zgarmasligi mumkin asosiysi uz, en, ru qilganingiz maqul. Keyin bu so'rovni bir marta ishlatish kerak bo'lmasa keyin bot nomini oʻzgartirolmasligingiz mumkin
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
1 8 5 4👍1🔥1
Botning chatida har bitta foydalanuvchi uchun webapp link
Shuningdek guruh va foydalanuvchi chati uchun
Guruh uchun
Shaxsiy chatda
©️ Manba: @vip_kodlar
✅ Dasturchi: @DrLiviesey
bot('setChatMenuButton',[
'chat_id'=>$chat_id,
'menu_button'=>json_encode([
'type'=>"web_app",
'text'=>"🕹 Play",
'web_app'=>['url'=>"foydalanuvchi uchun link"]
])
]);Shuningdek guruh va foydalanuvchi chati uchun
/bot_buyruqlariGuruh uchun
bot('setMyCommands', [
'commands' => json_encode([
["command" => "/top", "description" => "🏆 Top reyting"],
["command" => "/help", "description" => "🔆 Bot buyruqlari"]
]),
'scope' => json_encode([
'type' => "all_group_chats",
]),
]);Shaxsiy chatda
bot('setMyCommands', [
'commands' => json_encode([
["command" => "/start", "description" => "♻️ Botni ishga tushirish"],
["command" => "/profile", "description" => "👤 Profil"]
]),
'scope' => json_encode([
'type' => "all_private_chats",
]),
]);Please open Telegram to view this post
VIEW IN TELEGRAM
2 8 7 6👍3🔥1
Google Cloud Shell ishlatib ko'ringlar 5 Gb uy katalogingiz seanslar davomida saqlanib qoladi, lekin VM vaqtinchalik va qayta tiklanadi
seansingiz tugaganidan keyin taxminan 20 daqiqa. Tizim bo'ylab hech qanday o'zgarish bundan keyin davom etmaydi.
seansingiz tugaganidan keyin taxminan 20 daqiqa. Tizim bo'ylab hech qanday o'zgarish bundan keyin davom etmaydi.
1 2 1
Foydalanuvchilarga bitta so'rov bilan ko'proq xabar jo'natish
Qo'shimcha malumot: Hozirda 15 ta bu normal deb o'ylayman chunki telegram documentida sekuntiga 30 ta agar oylik foydalanuvchilar 100k dan oshgan bo'lsa 1000 ta xabar yuborsa bo'ladi albatta har bitta xabar 0.1 Telegram Yulduzcha⭐
©️ Manba: @vip_kodlar
✅ Dasturchi: @DrLiviesey
<?php
$token = "TOKEN";
function bot_multi($requests) {
$mh = curl_multi_init();
$curl_array = [];
foreach ($requests as $key => $req) {
$url = "https://api.telegram.org/bot" . $token . "/sendmessage";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $req);
curl_multi_add_handle($mh, $ch);
$curl_array[$key] = $ch;
}
$running = null;
do {
curl_multi_exec($mh, $running);
} while ($running > 0);
foreach ($curl_array as $ch) {
curl_multi_remove_handle($mh, $ch);
curl_close($ch);
}
curl_multi_close($mh);
}
$get = file_get_contents("users.txt");
$users = array_filter(array_map('trim', explode("\n", $get)));
$batch_size = 15; // Bir vaqtda nechta xabar yuborish
$chunks = array_chunk($users, $batch_size);
$i=1;
foreach ($chunks as $batch) {
$requests = [];
foreach ($batch as $id) {
$requests[] = [
'chat_id' => $id,
'parse_mode'=>'html',
'text' => "Salom, foydalanuvchilarga xabar",
'reply_markup'=>json_encode([
'inline_keyboard'=>[
[['text'=>"Share",'url'=>"https://t.me/VIP_KODLAR"]]
]
]),
];
}
bot_multi($requests);
echo "$i. ✅ " . count($batch) . " ta xabar yuborildi\n";
$i++;
sleep(3);
}
echo "🚀 Barcha xabarlar yuborildi!";
?>
Qo'shimcha malumot: Hozirda 15 ta bu normal deb o'ylayman chunki telegram documentida sekuntiga 30 ta agar oylik foydalanuvchilar 100k dan oshgan bo'lsa 1000 ta xabar yuborsa bo'ladi albatta har bitta xabar 0.1 Telegram Yulduzcha
Please open Telegram to view this post
VIEW IN TELEGRAM
1 9 7 4
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