Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting(0);
- if(!file_exists("_token.txt")){
- $gx = readline("Help ! ID => ");
- file_put_contents("_id.txt", $gx);
- }
- if(!file_exists("_ad.txt")){
- file_put_contents("_ad.txt","");
- }
- if(!file_exists("_ch.txt")){
- file_put_contents("_ch.txt", "@FFFFF");
- }
- if(!file_exists("_users.txt")){
- file_put_contents("_users.txt", "FFFFF");
- }
- if(!file_exists("_token.txt")){
- $g = readline("token : ");
- file_put_contents("_token.txt", $g);
- }
- $Rid = 0;//Id restart file CH..
- function bot($method,$datas=[]){
- $token = file_get_contents("_token.txt");
- $url = "https://api.telegram.org/bot$token/".$method;
- $ch = curl_init();
- curl_setopt($ch,CURLOPT_URL,$url);
- curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
- curl_setopt($ch,CURLOPT_POSTFIELDS,$datas);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
- $res = curl_exec($ch);
- curl_close($ch);
- return json_decode($res,true);
- echo json_encode($res,true);
- }
- function getupdates($up_id){
- $get = bot('getupdates',[
- 'offset'=>$up_id
- ]);
- return end($get['result']);
- }
- $botuser = "@".bot('getme',['bot'])["result"]["username"];
- file_put_contents("_ad.txt", $botuser);
- function ph($ph,$cc){
- if (!file_exists('madeline.php')) {
- copy('https://phar.madelineproto.xyz/madeline.php', 'madeline.php');
- }
- include 'madeline.php';
- unlink("me.madeline");
- unlink("me.madeline.lock");
- $settings['app_info']['api_id'] = 734261;//get the api (id) from https://my.telegram.org
- $settings['app_info']['api_hash'] = 'ceef0f699170642cf694c8bc072aaf27';//get the api (Hash) from https://my.telegram.org
- $MadelineProto = new \danog\MadelineProto\API('me.madeline', $settings);
- try{
- $vv = $MadelineProto->phone_login($ph);
- echo json_encode($vv);
- bot('sendMessage',[
- 'chat_id'=>$cc,
- 'text'=>"send me the msg from Telegram"
- ]);
- }catch(Exception $e){
- bot('sendMessage',[
- 'chat_id'=>$cc,
- 'text'=>"i cant login to acc"
- ]);
- }return false;
- }
- while(1){
- echo "hi";
- $last_up = $last_up;
- $get_up = getupdates($last_up+1);
- $last_up = $get_up['update_id'];
- $message = $get_up['message'];
- $userID = $message['from']['id'];
- $chat_id = $message['chat']['id'];
- $text = $message['text'];
- if($text){
- $code ="";
- if(preg_match("/رمز الدخول:/",$text)){
- $ex = str_replace("رمز الدخول: ", "", $text);
- $ex = explode(". لا تعطه أبدًا",$ex);
- $code = $ex[0];
- }elseif(preg_match("/Login code:/",$text)){
- $ex = str_replace("Login code: ", "", $text);
- $ex = explode(". Do not give",$ex);
- $code = $ex[0];
- }
- try{
- if($code != ""){
- $value = $MadelineProto->complete_phone_login(intval($code));
- echo json_encode($value);
- bot('sendMessage',[
- 'chat_id'=>$cc,
- 'text'=>"done wit to restart th chekar"
- ]);
- exec("pm2 start $Rid");
- break;
- }
- }catch(Exception $e){
- }
- }
- sleep(0);
- }
- }
- function random($one,$t){
- $out = "";
- $randomx = array('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',1,2,3,4,5,6,7,8,9,0);
- $randomxx = array('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z');
- if($t=="@"){
- for ($i = 0; $i < count($randomx); $i++) {
- $two = $randomx[$i];
- $out = $out."@".$one.$two.$two.$two.$two."\n";
- }return $out;
- }elseif($t=="b"){
- for ($i = 0; $i < count($randomx); $i++) {
- $two = $randomx[$i];
- $out = $out.$one.$two.$two.$two.$two."\n";
- }return $out;
- }elseif($t=="zx"){
- $ex = explode("-",$one);
- $o=$ex[0];
- $t=$ex[1];
- $out = $out."@".$o.$t.$t.$t.$t."\n";
- $out = $out."@".$t.$o.$t.$t.$t."\n";
- $out = $out."@".$t.$t.$o.$t.$t."\n";
- $out = $out."@".$t.$t.$t.$o.$t."\n";
- $out = $out."@".$t.$t.$t.$t.$o."\n";
- $out = $out."@".$t.$o.$o.$o.$o."\n";
- $out = $out."@".$o.$t.$o.$o.$o."\n";
- $out = $out."@".$o.$o.$t.$o.$o."\n";
- $out = $out."@".$o.$o.$o.$t.$o."\n";
- $out = $out."@".$o.$o.$o.$o.$t."\n";
- return $out;
- }elseif($t=="*"){
- if(!preg_match("/^_/",$one)){
- for ($i = 0; $i < count($randomx); $i++) {
- $two = $randomx[$i];
- $st = str_replace("_",$two , $one);
- $out = $out."@".$st."\n";
- }return $out;
- }else{
- for ($i = 0; $i < count($randomxx); $i++) {
- $two = $randomxx[$i];
- $st = str_replace("_",$two , $one);
- $out = $out."@".$st."\n";
- }return $out;
- }
- }elseif(preg_match("/list/",$t)){
- $b = array('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z');
- $o = explode("—", $t)[1];
- for ($y = 0; $y < count($b); $y++) {
- $n = $b[$y];
- print($o."——".$n."\n");
- $out = $out."@".$o.$n.$n.$n.$n."\n";
- $out = $out."@".$n.$o.$n.$n.$n."\n";
- $out = $out."@".$n.$n.$o.$n.$n."\n";
- $out = $out."@".$n.$n.$n.$o.$n."\n";
- $out = $out."@".$n.$n.$n.$n.$o."\n";
- }
- return $out;
- }elseif(preg_match("/nlis/",$t)){
- $b = array('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z');
- $o = explode("—", $t)[1];
- for ($y = 0; $y < count($b); $y++) {
- $n = $b[$y];
- print($o."——".$n."\n");
- $out = $out.$n.$o.$n.$n.$n."\n";
- $out = $out.$n.$n.$o.$n.$n."\n";
- $out = $out.$n.$n.$n.$o.$n."\n";
- $out = $out.$n.$n.$n.$n.$o."\n";
- }
- return $out;
- }
- }
- /*
- $a = array('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z');
- for ($i = 0; $i < count($a); $i++) {
- $out = "";
- $o = random("v","list—".$a[$i]);
- file_put_contents("test.txt", $o,FILE_APPEND);
- }
- $a = array('_');
- for ($i = 0; $i < count($a); $i++) {
- $out = "";
- $o = random("v","nlis—".$a[$i]);
- file_put_contents("_a.txt", $o,FILE_APPEND);
- }*/
- function countUsers(){
- $users = explode("\n", file_get_contents("_users.txt"));
- $list = "";
- $i=1;
- foreach($users as $user){
- if($user != ""){
- $list = $list."\n$i - @$user";
- $i++;
- }
- }
- if($list == ""){
- return "no Users";
- }else{
- return $list;
- }
- }
- function run($update){
- $message = $update['message'];
- $userID = $message['from']['id'];
- $chat_id = $message['chat']['id'];
- $text = $message['text'];
- $date = $update['callback_query']['data'];
- $group =file_get_contents("_id.txt");
- if(preg_match("/\/send (.*)/",$text)){
- $f = str_replace("/send ","", $text);
- bot('sendMessage',[
- 'chat_id'=>$group,
- 'text'=>$f
- ]);
- }
- if ($chat_id == $group){
- echo "$chat_id | $text \n";
- $users = explode("\n", file_get_contents("_users.txt"));
- $info = json_decode(file_get_contents('_info.json'),true);
- if(preg_match("/\/on @(.*)/",$text)){
- $user = explode("@",strtoupper($text))[1];
- if(!in_array($user, $users)){
- if(count(explode("\n", file_get_contents("_users.txt"))) !=10000000){
- file_put_contents("_users.txt","\n".$user,FILE_APPEND);
- bot('sendMessage',[
- 'chat_id'=>$chat_id,
- 'text'=>"Added to list ~> @$user"
- ]);
- }else{
- bot('sendMessage',[
- 'chat_id'=>$chat_id,
- 'text'=>"Boss You Cannot Add More than 20"
- ]);
- }
- }else{
- bot('sendMessage',[
- 'chat_id'=>$chat_id,
- 'text'=>"The user already on list @$user"
- ]);
- }
- }
- if(preg_match("/\/start/",$text)){
- bot('sendMessage',[
- 'chat_id'=>$group,
- 'text'=>"Hi Sir The Checker is Ready\n~ /help For Information\n~ Channel @SsYsS"
- ]);
- }
- if(preg_match("/\/list(.*)/",$text)){
- $ex = str_replace(["/list\n","/list \n"], "", strtoupper($text));
- $ex = explode("\n", $ex);
- $n = 0;
- foreach($ex as $u){
- $users = explode("\n", file_get_contents("_users.txt"));
- $user = explode("@",$u)[1];
- if(!in_array($user, $users)){
- if(count( explode("\n", file_get_contents("_users.txt"))) !=10000000){
- file_put_contents("_users.txt","\n".$user,FILE_APPEND);
- bot('sendMessage',[
- 'chat_id'=>$chat_id,
- 'text'=>"@$user ~> Added To List"
- ]);
- $n++;
- }else{
- bot('sendMessage',[
- 'chat_id'=>$chat_id,
- 'text'=>"i cannot add more than 20"
- ]);
- }
- }else{
- bot('sendMessage',[
- 'chat_id'=>$chat_id,
- 'text'=>"@$user already in the list"
- ]);
- }
- if($n == 15){
- $n = 0;
- sleep(60);
- }
- }
- $n = 0;
- }
- if(preg_match("/\/help/",$text)){
- bot('sendMessage',[
- 'chat_id'=>$group,
- 'text'=>"~ Help !\n===========\n/users => اليوزرات المضافة ;\n/clear => حذف جميع اليوزرات ;\n/list => تثبيت على لستة يوزرات ;\n/on => تثبيت على يوزر معين ;\n/off => الغاء التثبيت على معرف معين ;\n===========\nBy : @FFFFF - @XXYXX"
- ]);
- }
- if(preg_match("/\/off @(.*)/",$text)){
- $user = explode("@",strtoupper($text))[1];
- if(in_array($user, $users)){
- $data = str_replace("\n".$user,"", file_get_contents("_users.txt"));
- file_put_contents("_users.txt", $data);
- bot('sendMessage',[
- 'chat_id'=>$chat_id,
- 'text'=>"@$user ~> off"
- ]);
- }
- }
- if(preg_match("/\/clear/",$text)){
- file_put_contents("_users.txt", "");
- bot('sendMessage',[
- 'chat_id'=>$chat_id,
- 'text'=>"All cleared"
- ]);
- }
- if(preg_match("/\/users/",$text) ){
- bot('sendMessage',[
- 'chat_id'=>$chat_id,
- 'text'=>"Users List ~> \n ".countUsers()
- ]);
- }
- if(preg_match("/\/ph /",$text)){
- exec("pm2 stop $Rid");
- $ph = explode(" ",$text)[1];
- ph($ph,$chat_id);
- }
- }
- }
- while(true){
- $last_up = $last_up;
- $get_up = getupdates($last_up+1);
- $last_up = $get_up['update_id'];
- run($get_up);
- sleep(0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement