Аьзамхон Иномов
#61
DjHuSo, demak functiondagi fuktsiyalardan foydalanib qoshimcha rasm yoki yangiliklarni ham yuborish mumkin shundaymi
DjHuSo
#62
Azamchik, Ha imkoni bor ozgina bosh qotirsangiz
Akbarali
#63
Master-X, # Master-X (24.01.2019 / 16:32)
Kutubxonana imenna qayerdan olsam bo'ladi githubdan bergan likingizda tushunmadim
Bu degani Composer bilan ishlaydi degani. Juda kerakli narsa ekan o`rganish kerak
Аьзамхон Иномов
#64
DjHuSo, ha endi endi tushinishni boshladim rahmat
WapUsta
#65
30 martdan boshlab telegram api bilan ishlash o'zgardimi?
Telegram bot bilan sayt ni aloqasi uzildi.
Akbarali
#66
WapUsta, # WapUsta (02.04.2020 / 23:10)
30 martdan boshlab telegram api bilan ishlash o'zgardimi?
Telegram bot bilan sayt ni aloqasi uzildi.
Ishlayapti muammosiz avvalgiday
Ali AVFO Xujandiy
#67
Mavzu chang bosib ketibdi, faollashmaymizmi?
Akbarali
#68
Shaxsan o`zim telegram botda php curldan emas Guzzle, PHP HTTP client da yozishni boshladim. Tezligi ancha yaxshi bo`lar ekan.
Guzledagi botga namuna:
  1. <?php
  2. require_once( 'vendor/autoload.php' );
  3. use GuzzleHttp\Client;
  4. $apiKey = '<TOKEN>'; // Put your bot's API key here
  5. $apiURL = 'https://api.telegram.org/bot' . $apiKey . '/';
  6. $client = new Client( array( 'base_uri' => $apiURL ) );
  7. $update = json_decode(file_get_contents( 'php://input' ) );
  8.  
  9. $chatid = $update->message->chat->id;
  10. $type = $update->message->chat->type;
  11. $lastname = $update->message->chat->last_name;
  12. $fristname = $update->message->chat->first_name;
  13. $keyboard2 = json_encode(['inline_keyboard' => [[['url' => 'https://t.me/convertor_group', 'text' => 'Guruhga qo`shilish'], ], [['url' => 'https://uzhackersw.uz/', 'text' => 'Saytga kirish'], ], ], ]);
  14. $keyboard = json_encode(['inline_keyboard' => [[['url' => 'https://t.me/convertor_group', 'text' => 'Guruhimiz'], ], [['url' => 'https://uzhackersw.uz/', 'text' => 'Saytga kirish'], ], ], ]);
  15. $akbarali = '<ADMIN_ID>';
  16. $guruhim = '<CHAT_ID>';
  17.  
  18. if ( $update->message->text == 'Hello' ){
  19. $client->post( 'sendChatAction', array( 'query' => array( 'chat_id' => $chatid, 'action' => "typing" ) ) );
  20. $client->post( 'sendMessage', array( 'query' => array( 'chat_id' => $chatid, 'text' => "Bu Guzledan yuborilgan xabar" ) ) );
  21.  
  22. }
  23.  
  24. if ( $update->message->text == 'file' ){
  25. $client->post( 'sendChatAction', array( 'query' => array( 'chat_id' => $chatid, 'action' => "upload_video" ) ) );
  26. $client->post( 'sendDocument', array( 'query' => array( 'chat_id' => $chatid, 'document' => "https://uzfor.uz/view.php?act=file&id=2472" ) ) );
  27.  
  28. }
  29.  
  30.  
  31. if ( $update->message->text == '/start' ){
  32. $client->post( 'sendMessage', array( 'query' => array(
  33. 'chat_id' => $chatid,
  34. 'text' => "Salom " . $fristname. " " .$lastname . ". Men JPG rasmni PDF qilish sizga tashlash uchun @kbarali tomonidan yozildim. Menga rasm tashlashdan oldin /boshla buyrug`ini bering. Keyin JPG rasmni PHOTO qilish tashlang (file qilib emas)!", 'parse_mode' => 'html', 'reply_markup' => $keyboard2)));
  35. }
Danebay
#69
Shu tushunarsiz harflarni, kril alefboridagi harflarni o'rniga boshqa shtrixlangan kodni ochishni buyursakchi.
Lekin unga SSL Sertifikat bermasa kerak a ;-)

Hackerlar shtrixlangan yozishmalarni qanday o'qishi endi ma'lum.

Maqolaga gap yo'q. Zo'r
33
Tayota
#70
Sorovda qandaydur xatolik bolsa uni ekran yoki faylga yozishni iloji bormi?
1 daqiqa 56 soniyadan keyin yozdi:
<?php
date_default_timezone_set('Asia/Tashkent');

//bot malumotlari
define('API_KEY', '1999018049:AAGxOv5S6On1qrsJvrCFteG1rhuBfiNCasA');


echo 'SetWebHook: <a href="https://api.telegram.org/bot'.API_KEY.'/setwebhook?url='.$_SERVER["SERVER_NAME"].''.$_SERVER["SCRIPT_NAME"].'"> https://api.telegram.org/bot&#039;.API_KEY.&#039;/setwebhook?url='.$_SERVER["SERVER_NAME"].''.$_SERVER["SCRIPT_NAME"].' </a> <hr/>';


//sorov yuborish
function tayota($uslub, $sorov = []) {
$manzil = 'https://api.telegram.org/bot'.API_KEY.'/'.$uslub;
$req = curl_init();
curl_setopt($req, CURLOPT_URL, $manzil);
curl_setopt($req, CURLOPT_RETURNTRANSFER, true);
curl_setopt($req, CURLOPT_POST, true);
curl_setopt($req, CURLOPT_POSTFIELDS, $sorov);
$res = curl_exec($req);
//curl_close($req);
if (curl_error($req)) {
var_dump(curl_error($req));
} else {
return json_decode($res);
}


}


//bot yozmoqda
function yozmoqda($chat_id, $turi = 'typing') {
tayota('sendChatAction', [
'chat_id' => ''.$chat_id.'',
'action' => ''.$turi.''
]);
}


//malumotlarni faylga saqlab qoyamiz
file_put_contents('sorov.txt', file_get_contents('php://input'));


//malumotlarni ózgaruvchiga saqlab olamiz
$tg = json_decode(file_get_contents('php://input'));
$xabar = $tg->message;
$xabar_matni = $xabar->text;
$chat_id = $xabar->chat->id;
$kimdan_id = $xabar->from->id;
$xabar_id = $xabar->message_id;
$ismi = $xabar->from->first_name;
$familyasi = $xabar->from->last_name;
$username = $xabar->from->username;
$toliq_ism = $ismi.' '.$familyasi;


if ($xabar_matni == "/start") {

file_put_contents('go.txt', file_get_contents('php://input'));



yozmoqda($chat_id, 'typing');

$matn = 'Salom botga xush kelibsiz';
tayota('sendMessage', [
'chat_id' => ''.$chat_id.'',
'parse_mode' => 'html',
'text' => 'salom'
]);


file_put_contents('ok.txt', file_get_contents('php://input'));


} else {
file_put_contents('log.txt', file_get_contents('php://input'));





}
3 daqiqa 10 soniyadan keyin yozdi:
Manashu ishlamayapti bironta xatolik ham kelmabdi logOut da

Oxiri negadur tg meni blokladi

{"ok":false,"error_code":401,"description":"Unauthorized"}

Kunduzi: °C

7 Feb 2026 yil
Joylashuv aniqlanmadi
CORES.UZ
Платформа разработчиков
который можно найти всё
UZFOR.NET - Rasmiy guruh
t.me/@uzfornet_rasmiy