#function #captcha
Manba: @By_Alik
$step = file_get_contents("data/$cid.step");
$data = file_get_contents("data/$cid.txt");
mkdir("data");
if(isset($message)){
if($data == null){
$rand = rand(0000,9999);
bot('sendMessage',[
'chat_id'=>$cid,
'text'=>"<b>Quyidagi captcha kodni kiriting:</b>
๐ <code>$rand</code>",
'parse_mode'=>'html',
]);
file_get_contents("data/$cid.step","captcha-$rand");
}
}
//<---- @By_Alik ---->//
if(mb_stripos($step, "captcha-") !== false){
$captcha = explode("-", $step)[1];
if(is_numeric($text) == true){
if($captcha == $text){
bot('sendMessage',[
'chat_id'=>$cid,
'text'=>"โ
<b>Captchadan muvaffaqiyatli o'tdingiz!</b>",
'parse_mode'=>'html',
]);
file_put_contents("data/$cid.txt",'on');
unlink("data/$cid.step");
}else{
bot('sendMessage',[
'chat_id'=>$cid,
'text'=>"<b>Qabul qilinmadi!</b>
Qayta urunib ko'ring:",
'parse_mode'=>'html',
]);
}
}else{
bot('sendMessage',[
'chat_id'=>$cid,
'text'=>"<b>Faqat raqamlardan foydalaning!</b>",
'parse_mode'=>'html',
]);
}
}
Telegram botlar uchun soddagina captcha funksiyasi.Manba: @By_Alik
๐5
#function #hidden_button
Ma'lum bir tugmani admin bo'lmagan foydalanuvchilarga ko'rinmaydigan qilish.
Manba: @By_Alik
$admin = "id";
$a = json_encode([
'resize_keyboard'=>true,
'keyboard'=>[
[['text'=>"โ Buyurtma berish"]],
]
]);
$b = json_encode([
'resize_keyboard'=>true,
'keyboard'=>[
[['text'=>"โ Buyurtma berish"]],
[['text'=>"๐ Boshqarish"]],
]
]);
//<---- @By_Alik ---->//
if($cid == $admin){
$menu = $b;
}else{
$menu = $a;
}
if($text == "/start"){
bot('sendMessage',[
'chat_id'=>$cid,
'text'=>"<b>Salom $name!</b>",
'parse_mode'=>'html',
'reply_markup'=>$menu
]);
}
Ma'lum bir tugmani admin bo'lmagan foydalanuvchilarga ko'rinmaydigan qilish.
Manba: @By_Alik
๐3
#function #delete
5 minutdan keyin o'chib ketadigan xabar funksiyasi.
if($text == "/start"){
$a = bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>"<b>Salom $name!</b>",
'parse_mode'=>'html',
])->result->message_id;
sleep(300);
bot('deleteMessage',[
'chat_id'=>$chat_id,
'message_id'=>$a
]);
}
5 minutdan keyin o'chib ketadigan xabar funksiyasi.
๐
7๐5โ2๐1
if($text == "/sendmail"){
$sub = "Sarlavha yoziladi";
$message = "Matn yoziladi";
$text = "fine.coders@gmail.com";//E-Mail yoziladi
$headers = 'From: FineCoders' . "\r\n" . 'Reply-To: FineCoders' . "\r\n" . 'X-Mailer: PHP/' . phpversion();
mail($text,$sub,$message,$headers);
exit();
}โโโโโโโโโ
โก๏ธ #function #mail #php #send
๐ฅ PHP'da e-pochta manziliga xabar yuboruvchi funksiya! Ushbu funksiya orqali yuborilgan xabar faqat SPAM jildiga boradi.
๐ Reaksiyaga arziydigan funk ;)
๐ฃ Bizning kanal: @ITMaktabi1
Telegram | Instagram | YouTube | TikTok | GitHup | chat
๐14
Please open Telegram to view this post
VIEW IN TELEGRAM
๐11โค3๐ฅ3โคโ๐ฅ2
inAscOrder([1,2,4,7,19]); // trueTartibli yoki tartibsizligini tekshiradi
inAscOrder([1,2,3,4,5]); // true
inAscOrder([1,2,6,5,3]); // false
Please open Telegram to view this post
VIEW IN TELEGRAM