Oddiy message ichiga vaqtinchalik malumot saqlasa bo'ladi malumotlar bazasiga saqlamasdan text ichiga yani link ichiga yashirgan holda, uni olish albatta update bilan
Ishlatish
if ($text == "/text") {
$url = base64_encode("🇯🇵 Japan is transforming footsteps into electricity ⚡️
By using piezoelectric tiles, each step produces a small amount of energy. In high-traffic areas like Shibuya Station, millions of steps combine to power LED lights and digital displays—an innovative move toward smarter, more sustainable cities."); // bu yerga hohlagan matn yoki kesh
bot('sendmessage', [
'chat_id' => $chat_id,
'text' => "text saqlandi",
'disable_web_page_preview'=>true,
'parse_mode' => 'html',
'reply_markup' => json_encode([
"inline_keyboard" => [
[['text' => "saqlash", 'callback_data' => "saqlash"]]
]
])
]);
exit;
}
$callback = $update->callback_query;
$entities = $callback->message->entities;
if($data=="saqlash"){
bot('answerCallbackQuery', ['callback_query_id' => $call_id]);
$url = $entities[0]->url;
$base = base64_decode(substr($url,13));
bot('sendmessage', [
'chat_id' => $chat_id,
'text' => $base
]);
exit;
}
Albatta buni olish uchun callback data bosilsa yoki ushbu bot yuborgan message ni log chatga forward qilishi kerak boladi
Ishlatish
if ($text == "/text") {
$url = base64_encode("🇯🇵 Japan is transforming footsteps into electricity ⚡️
By using piezoelectric tiles, each step produces a small amount of energy. In high-traffic areas like Shibuya Station, millions of steps combine to power LED lights and digital displays—an innovative move toward smarter, more sustainable cities."); // bu yerga hohlagan matn yoki kesh
bot('sendmessage', [
'chat_id' => $chat_id,
'text' => "text saqlandi",
'disable_web_page_preview'=>true,
'parse_mode' => 'html',
'reply_markup' => json_encode([
"inline_keyboard" => [
[['text' => "saqlash", 'callback_data' => "saqlash"]]
]
])
]);
exit;
}
$callback = $update->callback_query;
$entities = $callback->message->entities;
if($data=="saqlash"){
bot('answerCallbackQuery', ['callback_query_id' => $call_id]);
$url = $entities[0]->url;
$base = base64_decode(substr($url,13));
bot('sendmessage', [
'chat_id' => $chat_id,
'text' => $base
]);
exit;
}
Albatta buni olish uchun callback data bosilsa yoki ushbu bot yuborgan message ni log chatga forward qilishi kerak boladi