$chat_id, 'text' => $text, 'parse_mode' => 'HTML' ]; if ($keyboard) { $data['reply_markup'] = json_encode($keyboard); } $ch = curl_init($API.'/sendMessage'); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_exec($ch); curl_close($ch); } function mainKeyboard($chat_id){ $keyboard = [ 'keyboard' => [ ['๐Ÿ Batafsil ma\'lumot'], ['๐Ÿ›’ Buyurtma berish'] ], 'resize_keyboard' => true ]; sendMessage($chat_id, "Kerakli boโ€˜limni tanlang ๐Ÿ‘‡", $keyboard); } /* START */ if ($text == "/start") { sendMessage( $chat_id, "๐Ÿ Assalomu alaykum!\n\nAsal Ari botiga xush kelibsiz.\n\nBizda toza va tabiiy asal mavjud.\nSifat kafolatlanadi โœ…" ); mainKeyboard($chat_id); } /* BATAFSIL MA'LUMOT */ elseif ($text == "๐Ÿ Batafsil ma'lumot") { sendMessage( $chat_id, "๐Ÿฏ Asal haqida batafsil maโ€™lumot\n\nQuyidagi havolada oโ€˜qishingiz mumkin ๐Ÿ‘‡\n\n๐Ÿ”— https://uz.wikipedia.org/wiki/Asal" ); } /* BUYURTMA */ elseif ($text == "๐Ÿ›’ Buyurtma berish") { sendMessage( $chat_id, "๐Ÿ›’ Narxlar:\n\n๐Ÿฏ 1 litr โ€” 100 000 soโ€˜m\n๐Ÿฏ 0.5 litr โ€” 50 000 soโ€˜m\n\nTelefon raqamingizni yuboring ๐Ÿ‘‡" ); $keyboard = [ 'keyboard' => [ [ [ 'text' => '๐Ÿ“ž Telefon raqamni yuborish', 'request_contact' => true ] ] ], 'resize_keyboard' => true, 'one_time_keyboard' => true ]; sendMessage($chat_id, "Tugmani bosing โฌ‡๏ธ", $keyboard); } /* TELEFON QABUL QILINDI */ elseif ($contact) { sendMessage( $chat_id, "โœ… Buyurtmangiz qabul qilindi!\n\nTez orada siz bilan bogโ€˜lanamiz.\nRahmat ๐Ÿ˜Š" ); mainKeyboard($chat_id); } echo "OK";