Individual Programmer </>
62 subscribers
2 photos
1 video
3 files
8 links
πŸ‘€ Admin: @BRaimqulov
__________________________________________

πŸ”΅ Git Hub: https://github.com/BotirRaimqulov
__________________________________________
Download Telegram
<?php
function bot($method, $datas = [])
{
$url = "https://api.telegram.org/bot" . API_KEY . "/" . $method;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $datas);
$res = curl_exec($ch);
if (curl_error($ch)) {
var_dump(curl_error($ch));
} else {
return json_decode($res);
}
}


function approveChatJoinRequest($channel_id, $user_id)
{
bot('approveChatJoinRequest', [
'chat_id' => $channel_id,
'user_id' => $user_id,
]);
}
function getChatMember($channel_id, $user_id)
{
$status = bot('getChatMember', [
'chat_id' => $channel_id,
'user_id' => $user_id,
]);
$status = $status->result->status;
return $status;
}

$update = json_decode(file_get_contents('php://input'));

if (isset($update)) {
if (isset($update->message)) {
$message = $update->message;
$text = $message->text;
$cid = $message->chat->id;
$mid = $message->message_id;
} elseif (isset($update->callback_query)) {
$data = $update->callback_query->data;
$mid = $update->callback_query->message->message_id;
$cid = $update->callback_query->message->chat->id;
} elseif (isset($update->chat_join_request)) {
$chname = $update->chat_join_request->chat->title;
$chuid = $update->chat_join_request->from->id;
$chid = $update->chat_join_request->chat->id;
$join = $update->chat_join_request;
}
}



if (isset($join)) {
$select = $db->query("SELECT * FROM channels WHERE main_channel=$chid AND secondary_channel IS NOT NULL");
if ($select->num_rows == 1) {
$f = $select->fetch_assoc();
$s_channel = $f['secondary_channel'];
if (in_array(getChatMember($s_channel, $chuid), ['member', 'administrator', 'creator'])) {
approveChatJoinRequest($chid, $chuid);
bot('sendMessage', [
'chat_id' => $chuid,
'text' => "Sizning so'rovingiz tasdiqlandi",
'parse_mode' => "html"
]);
} else {
file_put_contents("cache/" . $chuid . ".txt", $f['id']);
bot('sendMessage', [
'chat_id' => $chuid,
'text' => "Sizning so'rovingiz tasdiqlanishi uchun $s_channel ga obuna bo'ling, siznign so'rovingiz keyin tasdiqlanadi",
'parse_mode' => "html",
'reply_markup' => json_encode([
'inline_keyboard' => [
[['text' => "βœ… Obuna bo'ldim", 'callback_data' => "ok"]]
]
])
]);
}
} else {
approveChatJoinRequest($chid, $chuid);
bot('sendMessage', [
'chat_id' => $chuid,
'text' => "Sizning so'rovingiz tasdiqlandi",
'parse_mode' => "html"
]);
}
}


if ($data == "ok") {
$id = file_get_contents("cache/" . $cid . ".txt");
$select = $db->query("SELECT * FROM channels WHERE id=$id");
$f = $select->fetch_assoc();
$s_channel = $f['secondary_channel'];
if (in_array(getChatMember($s_channel, $cid), ['member', 'administrator', 'creator'])) {
$channel_id = $f['main_channel'];
approveChatJoinRequest($channel_id, $cid);
bot('sendMessage', [
'chat_id' => $cid,
'text' => "Sizning so'rovingiz tasdiqlandi",
'parse_mode' => "html"
]);
}
}





CREATE TABLE channels (
id INT AUTO_INCREMENT PRIMARY KEY,
main_channel VARCHAR(255) NOT NULL,
secondary_channel VARCHAR(255)
);


❗️Webhookda: allowed_updates=["message","edited_channel_post", "callback_query","my_chat_member","chat_member","chat_join_request"]
πŸ‘Œ4πŸ†’2❀1🌚1😐1
Davay obunachila pul yigβ€˜ib sovgβ€˜a olila nxπŸ˜‚

9860120140779519
🀯2🀣2
πŸ€–@Marvel_ManiaBot fikrπŸ‘
(Reklamaga etibor bermaymiz admin paneldan qoβ€˜shiladiπŸ˜…)

πŸ“Œp.s: sotamizπŸ˜‚
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ†’3β˜ƒ1✍1🌚1
#Maslaxat

Siz biron bir lohiya boshlayotganda avval aynan nimalar qilinishi kerakligini bilib oling, hoh u telegram bot bo'lsin, hoh sayt. Loyiha struktur ko'rinishini tuzing. Malumotlar bazasini korinishini tuzing. Keyin qolgan malumotlarni toplashni boshlashingiz mumkin. Hamma malumotlar to'liq bo'lgach sekin kod yozishni boshlashingiz mumkin.
Forwarded from Foydali botlar
πŸ†• Yangi telegram bot
πŸ“Ž Username: @Join_RequestBot
πŸ”– Vazifa:
βž• Kanalga kelgan yangi "qo'shilish so'rovlar"ini qabul qilish
βž• Kanaldagi eski "qo'shilish so'rovlar"ini qabul qilish

⚑️⚑️⚑️⚑️⚑️⚑️⚑️⚑️⚑️⚑️⚑️

βœ‰οΈ Bog'lanish: @BRAIMQULOV

πŸ•Š @t_me_bots && @FoydaliTelegramBotlar
Please open Telegram to view this post
VIEW IN TELEGRAM
5+ vaucher TonKeeperga tushishini kutyotgan men :(
😁5😒4🀣3
Assalomu alaykum 🌚
Yangi yilga nima qilamiz :)
πŸ€– Telegram botingiz uchun Webhook sozlashni osonlashtiring!
Endi Telegram botingizni sozlashda Apify Webhook sizga yordam beradi.

πŸ”— https://apify.uz/webhook/

βœ… Oddiy interfeys
βœ… Tez sozlash

Botingizni ishga tushirishni xohlaysizmi? Boshlash uchun havolani bosing! πŸš€
πŸ‘1