<?php
/*
---------------------#
--# By => @Mroan8
--# CH => @Mroan1235
--# CH => @php88:
---------------------#
*/
ob_start();
$API_KEY = "TOKEN-BOT";#توكن البوت
echo "<a href='https://api.telegram.org/bot$API_KEY/setwebhook?url=".$_SERVER['SERVER_NAME']."".$_SERVER['SCRIPT_NAME']."'>setwebhook</a>";
define('API_KEY',$API_KEY);
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);}}
#-----------------(mroan)--------------------#
$update = json_decode(file_get_contents('php://input'));
$message = $update->message;
$text = $message->text;
$chat_id = $message->chat->id;
$name = $message->from->first_name;
$user = $message->from->username;
$message_id = $update->message->message_id;
$from_id = $update->message->from->id;
$info = json_decode(file_get_contents("https://api.telegram.org/bot".API_KEY."/getChatMember?chat_id=@Mroan1235&user_id=".$from_id));
$per = $info->result->status;
if ($per == 'left') {
if (!in_array($chat_id, $us)) {
file_put_contents("gm.txt", $chat_id."\n",FILE_APPEND);
}
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>"
⚠️ عليك الأشتراك في القناة اولآ
قناة البوت @mroan1235 !!
"
]);
} else {
★★★★★★★★★★★★
#كود الاتصال بيه الاشتراك الاجباري والويب هوك من تسوي عرض للملف
@php88
$Alsh = ""; #توكن البوت الرفعته ادمن
$ali = ""; #معرف قناتك
$join = file_get_contents("https://api.telegram.org/bot".$Alsh."/getChatMember?chat_id=$ali&user_id=".$from_id);
if($message && (strpos($join,'"status":"left"') or strpos($join,'"Bad Request: USER_ID_INVALID"') or strpos($join,'"status":"kicked"'))!== false){
bot('sendMessage',['chat_id'=>$chat_id,
'text'=>"
اهلٱ عزيزي ، ٱشترك في قناة البوت
قناة البوت - $ali
• بـعـدَ الاشتراك الضغط • */start • ",
]);return false;}
كود اشتراك اجباري بعد ترفع فد بوت بالقناة وتضيف هل كود بكل بوتات راح يصير شتراك اجباري بكل بوتات بدون مترفعهن ادمن كلهن 📛.
طبعا هل كود مفيد حتي لا تتفلش قنواتكم استخدمو 💛.
~~~ ~~~ ~~~
#منقول 😊.
if($text == "/start"){
$BotToken = ""; #توكن
$botgetMe = json_decode(file_get_contents("https://api.telegram.org/bot".$BotToken."/getMe"));
$BotUserName = $botgetMe->result->username;
$result = json_decode(file_get_contents("https://api.telegram.org/bot".$BotToken."/SendChatAction?chat_id=".$from_id."&action=typing"),true)["ok"];
if(!$result){
bot('Sendmessage',[
'chat_id'=>$chat_id,
'text'=>"
👥 ؛ عليك اشتراك بل بوت التالي .
@".$BotUserName,
'reply_markup'=>json_encode([
'inline_keyboard'=>[
[['text'=>"اضغط هنا للاشتراك 👥", "url"=>"https://tttttt.me/".$BotUserName]],
]])
]);
return false;
}}
كود اشتراك اجباري لبوت
$BotToken = ""; #توكن
$botgetMe = json_decode(file_get_contents("https://api.telegram.org/bot".$BotToken."/getMe"));
$BotUserName = $botgetMe->result->username;
$result = json_decode(file_get_contents("https://api.telegram.org/bot".$BotToken."/SendChatAction?chat_id=".$from_id."&action=typing"),true)["ok"];
if(!$result){
bot('Sendmessage',[
'chat_id'=>$chat_id,
'text'=>"
👥 ؛ عليك اشتراك بل بوت التالي .
@".$BotUserName,
'reply_markup'=>json_encode([
'inline_keyboard'=>[
[['text'=>"اضغط هنا للاشتراك 👥", "url"=>"https://tttttt.me/".$BotUserName]],
]])
]);
return false;
}}
كود اشتراك اجباري لبوت
👍3
Forwarded from ملفات بوتات تلجرام استضافات سيرفرات شروحات lua php python safety برمجة بوتات برمجه بوتات تلجرام (𓏺𝐀𝐑𝐌𝐎𝐅)
الي بالبوت
هذا ثابت مكان ما رابط مالتي يصير الرابط مالكم
مال هذا الملف بالاستضافة الي تشتغل او السيرفر
<?php
ob_start();
$API_KEY = '929539849:AAGiaV2miPAZ6houjNS53lN20pCVmIlnLVk'; #توكن البوت
define('API_KEY',$API_KEY);
echo file_get_contents("https://tfhdg.000webhostapp.com/Telegram.php/bot$API_KEY/setwebhook?url=".$_SERVER['SERVER_NAME']."".$_SERVER['SCRIPT_NAME']);
function bot($method, $data = []){
$url = "https://tfhdg.000webhostapp.com/Telegram.php/bot".API_KEY."/" . $method;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$res = curl_exec($ch);
if (curl_error($ch)) {
var_dump(curl_error($ch));
} else {
return json_decode($res);
}
}
هذا ثابت مكان ما رابط مالتي يصير الرابط مالكم
مال هذا الملف بالاستضافة الي تشتغل او السيرفر
<?php
$url = $_SERVER['REQUEST_URI'];
$pattern = '/\/bot(.*?)\//';
preg_match($pattern, $url, $matches);
$token = $matches[1];
$pattern2 = '/\/bot[^\/]+\/([^?]+)/';
$link = $url;
preg_match($pattern2, $link, $matches2);
$method = $matches2[1];
define('API_KEY', $token);
function bot($method, $data = []) {
$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, $data);
$res = curl_exec($ch);
if (curl_error($ch)) {
var_dump(curl_error($ch));
} else {
return json_decode($res);
}
}
if($_GET){
$e = bot($method, $_GET);
echo json_encode($e,448); // Convert the response object to a JSON string before echoing
}if($_POST){
$e = bot($method, $_POST);
echo json_encode($e,448); // Convert the response object to a JSON string before echoing
}
?>
❤1👍1