Advertisement
Guest User

Ahmed Al-Majdi

a guest
May 24th, 2019
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.81 KB | None | 0 0
  1. <?php
  2. error_reporting(0);
  3. if(!file_exists("_token.txt")){
  4. $gx = readline("Help ! ID => ");
  5. file_put_contents("_id.txt", $gx);
  6. }
  7. if(!file_exists("_ad.txt")){
  8. file_put_contents("_ad.txt","");
  9. }
  10. if(!file_exists("_ch.txt")){
  11. file_put_contents("_ch.txt", "@FFFFF");
  12. }
  13. if(!file_exists("_users.txt")){
  14. file_put_contents("_users.txt", "FFFFF");
  15. }
  16. if(!file_exists("_token.txt")){
  17. $g = readline("token : ");
  18. file_put_contents("_token.txt", $g);
  19. }
  20. $Rid = 0;//Id restart file CH..
  21.  
  22. function bot($method,$datas=[]){
  23. $token = file_get_contents("_token.txt");
  24. $url = "https://api.telegram.org/bot$token/".$method;
  25. $ch = curl_init();
  26. curl_setopt($ch,CURLOPT_URL,$url);
  27. curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
  28. curl_setopt($ch,CURLOPT_POSTFIELDS,$datas);
  29. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  30. $res = curl_exec($ch);
  31. curl_close($ch);
  32. return json_decode($res,true);
  33. echo json_encode($res,true);
  34. }
  35. function getupdates($up_id){
  36. $get = bot('getupdates',[
  37. 'offset'=>$up_id
  38. ]);
  39. return end($get['result']);
  40.  
  41. }
  42. $botuser = "@".bot('getme',['bot'])["result"]["username"];
  43.  
  44. file_put_contents("_ad.txt", $botuser);
  45.  
  46. function ph($ph,$cc){
  47. if (!file_exists('madeline.php')) {
  48. copy('https://phar.madelineproto.xyz/madeline.php', 'madeline.php');
  49. }
  50. include 'madeline.php';
  51. unlink("me.madeline");
  52. unlink("me.madeline.lock");
  53. $settings['app_info']['api_id'] = 734261;//get the api (id) from https://my.telegram.org
  54. $settings['app_info']['api_hash'] = 'ceef0f699170642cf694c8bc072aaf27';//get the api (Hash) from https://my.telegram.org
  55. $MadelineProto = new \danog\MadelineProto\API('me.madeline', $settings);
  56. try{
  57. $vv = $MadelineProto->phone_login($ph);
  58. echo json_encode($vv);
  59. bot('sendMessage',[
  60. 'chat_id'=>$cc,
  61. 'text'=>"send me the msg from Telegram"
  62. ]);
  63. }catch(Exception $e){
  64. bot('sendMessage',[
  65. 'chat_id'=>$cc,
  66. 'text'=>"i cant login to acc"
  67. ]);
  68. }return false;
  69. }
  70.  
  71. while(1){
  72. echo "hi";
  73. $last_up = $last_up;
  74. $get_up = getupdates($last_up+1);
  75. $last_up = $get_up['update_id'];
  76. $message = $get_up['message'];
  77. $userID = $message['from']['id'];
  78. $chat_id = $message['chat']['id'];
  79. $text = $message['text'];
  80. if($text){
  81. $code ="";
  82. if(preg_match("/رمز الدخول:/",$text)){
  83. $ex = str_replace("رمز الدخول: ", "", $text);
  84. $ex = explode(". لا تعطه أبدًا",$ex);
  85. $code = $ex[0];
  86. }elseif(preg_match("/Login code:/",$text)){
  87. $ex = str_replace("Login code: ", "", $text);
  88. $ex = explode(". Do not give",$ex);
  89. $code = $ex[0];
  90. }
  91. try{
  92. if($code != ""){
  93. $value = $MadelineProto->complete_phone_login(intval($code));
  94. echo json_encode($value);
  95. bot('sendMessage',[
  96. 'chat_id'=>$cc,
  97. 'text'=>"done wit to restart th chekar"
  98. ]);
  99. exec("pm2 start $Rid");
  100. break;
  101. }
  102.  
  103. }catch(Exception $e){
  104.  
  105. }
  106. }
  107. sleep(0);
  108. }
  109.  
  110. }
  111.  
  112.  
  113. function random($one,$t){
  114. $out = "";
  115. $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);
  116. $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');
  117.  
  118. if($t=="@"){
  119. for ($i = 0; $i < count($randomx); $i++) {
  120. $two = $randomx[$i];
  121. $out = $out."@".$one.$two.$two.$two.$two."\n";
  122. }return $out;
  123. }elseif($t=="b"){
  124. for ($i = 0; $i < count($randomx); $i++) {
  125. $two = $randomx[$i];
  126. $out = $out.$one.$two.$two.$two.$two."\n";
  127. }return $out;
  128. }elseif($t=="zx"){
  129. $ex = explode("-",$one);
  130. $o=$ex[0];
  131. $t=$ex[1];
  132. $out = $out."@".$o.$t.$t.$t.$t."\n";
  133. $out = $out."@".$t.$o.$t.$t.$t."\n";
  134. $out = $out."@".$t.$t.$o.$t.$t."\n";
  135. $out = $out."@".$t.$t.$t.$o.$t."\n";
  136. $out = $out."@".$t.$t.$t.$t.$o."\n";
  137. $out = $out."@".$t.$o.$o.$o.$o."\n";
  138. $out = $out."@".$o.$t.$o.$o.$o."\n";
  139. $out = $out."@".$o.$o.$t.$o.$o."\n";
  140. $out = $out."@".$o.$o.$o.$t.$o."\n";
  141. $out = $out."@".$o.$o.$o.$o.$t."\n";
  142. return $out;
  143. }elseif($t=="*"){
  144. if(!preg_match("/^_/",$one)){
  145. for ($i = 0; $i < count($randomx); $i++) {
  146. $two = $randomx[$i];
  147. $st = str_replace("_",$two , $one);
  148. $out = $out."@".$st."\n";
  149. }return $out;
  150. }else{
  151. for ($i = 0; $i < count($randomxx); $i++) {
  152. $two = $randomxx[$i];
  153. $st = str_replace("_",$two , $one);
  154. $out = $out."@".$st."\n";
  155. }return $out;
  156. }
  157. }elseif(preg_match("/list/",$t)){
  158. $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');
  159. $o = explode("—", $t)[1];
  160. for ($y = 0; $y < count($b); $y++) {
  161. $n = $b[$y];
  162. print($o."——".$n."\n");
  163. $out = $out."@".$o.$n.$n.$n.$n."\n";
  164. $out = $out."@".$n.$o.$n.$n.$n."\n";
  165. $out = $out."@".$n.$n.$o.$n.$n."\n";
  166. $out = $out."@".$n.$n.$n.$o.$n."\n";
  167. $out = $out."@".$n.$n.$n.$n.$o."\n";
  168.  
  169. }
  170.  
  171. return $out;
  172.  
  173. }elseif(preg_match("/nlis/",$t)){
  174. $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');
  175. $o = explode("—", $t)[1];
  176. for ($y = 0; $y < count($b); $y++) {
  177. $n = $b[$y];
  178. print($o."——".$n."\n");
  179. $out = $out.$n.$o.$n.$n.$n."\n";
  180. $out = $out.$n.$n.$o.$n.$n."\n";
  181. $out = $out.$n.$n.$n.$o.$n."\n";
  182. $out = $out.$n.$n.$n.$n.$o."\n";
  183.  
  184. }
  185.  
  186. return $out;
  187.  
  188. }
  189.  
  190.  
  191. }
  192. /*
  193. $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');
  194. for ($i = 0; $i < count($a); $i++) {
  195. $out = "";
  196. $o = random("v","list—".$a[$i]);
  197. file_put_contents("test.txt", $o,FILE_APPEND);
  198. }
  199.  
  200.  
  201. $a = array('_');
  202. for ($i = 0; $i < count($a); $i++) {
  203. $out = "";
  204. $o = random("v","nlis—".$a[$i]);
  205. file_put_contents("_a.txt", $o,FILE_APPEND);
  206. }*/
  207. function countUsers(){
  208. $users = explode("\n", file_get_contents("_users.txt"));
  209. $list = "";
  210. $i=1;
  211. foreach($users as $user){
  212. if($user != ""){
  213. $list = $list."\n$i - @$user";
  214. $i++;
  215. }
  216. }
  217. if($list == ""){
  218. return "no Users";
  219. }else{
  220. return $list;
  221. }
  222.  
  223. }
  224. function run($update){
  225. $message = $update['message'];
  226. $userID = $message['from']['id'];
  227. $chat_id = $message['chat']['id'];
  228. $text = $message['text'];
  229. $date = $update['callback_query']['data'];
  230. $group =file_get_contents("_id.txt");
  231. if(preg_match("/\/send (.*)/",$text)){
  232. $f = str_replace("/send ","", $text);
  233. bot('sendMessage',[
  234. 'chat_id'=>$group,
  235. 'text'=>$f
  236. ]);
  237. }
  238. if ($chat_id == $group){
  239. echo "$chat_id | $text \n";
  240. $users = explode("\n", file_get_contents("_users.txt"));
  241. $info = json_decode(file_get_contents('_info.json'),true);
  242. if(preg_match("/\/on @(.*)/",$text)){
  243.  
  244. $user = explode("@",strtoupper($text))[1];
  245. if(!in_array($user, $users)){
  246. if(count(explode("\n", file_get_contents("_users.txt"))) !=10000000){
  247. file_put_contents("_users.txt","\n".$user,FILE_APPEND);
  248. bot('sendMessage',[
  249. 'chat_id'=>$chat_id,
  250. 'text'=>"Added to list ~> @$user"
  251. ]);
  252. }else{
  253. bot('sendMessage',[
  254. 'chat_id'=>$chat_id,
  255. 'text'=>"Boss You Cannot Add More than 20"
  256. ]);
  257. }
  258. }else{
  259. bot('sendMessage',[
  260. 'chat_id'=>$chat_id,
  261. 'text'=>"The user already on list @$user"
  262. ]);
  263. }
  264. }
  265. if(preg_match("/\/start/",$text)){
  266. bot('sendMessage',[
  267. 'chat_id'=>$group,
  268. 'text'=>"Hi Sir The Checker is Ready\n~ /help For Information\n~ Channel @SsYsS"
  269. ]);
  270. }
  271. if(preg_match("/\/list(.*)/",$text)){
  272. $ex = str_replace(["/list\n","/list \n"], "", strtoupper($text));
  273. $ex = explode("\n", $ex);
  274. $n = 0;
  275. foreach($ex as $u){
  276. $users = explode("\n", file_get_contents("_users.txt"));
  277. $user = explode("@",$u)[1];
  278. if(!in_array($user, $users)){
  279. if(count( explode("\n", file_get_contents("_users.txt"))) !=10000000){
  280. file_put_contents("_users.txt","\n".$user,FILE_APPEND);
  281. bot('sendMessage',[
  282. 'chat_id'=>$chat_id,
  283. 'text'=>"@$user ~> Added To List"
  284. ]);
  285. $n++;
  286. }else{
  287. bot('sendMessage',[
  288. 'chat_id'=>$chat_id,
  289. 'text'=>"i cannot add more than 20"
  290. ]);
  291. }
  292. }else{
  293. bot('sendMessage',[
  294. 'chat_id'=>$chat_id,
  295. 'text'=>"@$user already in the list"
  296. ]);
  297. }
  298. if($n == 15){
  299. $n = 0;
  300. sleep(60);
  301. }
  302. }
  303. $n = 0;
  304. }
  305.  
  306. if(preg_match("/\/help/",$text)){
  307. bot('sendMessage',[
  308. 'chat_id'=>$group,
  309. 'text'=>"~ Help !\n===========\n/users => اليوزرات المضافة ;\n/clear => حذف جميع اليوزرات ;\n/list => تثبيت على لستة يوزرات ;\n/on => تثبيت على يوزر معين ;\n/off => الغاء التثبيت على معرف معين ;\n===========\nBy : @FFFFF - @XXYXX"
  310. ]);
  311. }
  312. if(preg_match("/\/off @(.*)/",$text)){
  313. $user = explode("@",strtoupper($text))[1];
  314. if(in_array($user, $users)){
  315. $data = str_replace("\n".$user,"", file_get_contents("_users.txt"));
  316. file_put_contents("_users.txt", $data);
  317. bot('sendMessage',[
  318. 'chat_id'=>$chat_id,
  319. 'text'=>"@$user ~> off"
  320. ]);
  321. }
  322. }
  323. if(preg_match("/\/clear/",$text)){
  324. file_put_contents("_users.txt", "");
  325. bot('sendMessage',[
  326. 'chat_id'=>$chat_id,
  327. 'text'=>"All cleared"
  328. ]);
  329. }
  330. if(preg_match("/\/users/",$text) ){
  331. bot('sendMessage',[
  332. 'chat_id'=>$chat_id,
  333. 'text'=>"Users List ~> \n ".countUsers()
  334. ]);
  335. }
  336.  
  337. if(preg_match("/\/ph /",$text)){
  338. exec("pm2 stop $Rid");
  339. $ph = explode(" ",$text)[1];
  340. ph($ph,$chat_id);
  341.  
  342. }
  343.  
  344. }
  345. }
  346. while(true){
  347. $last_up = $last_up;
  348. $get_up = getupdates($last_up+1);
  349. $last_up = $get_up['update_id'];
  350. run($get_up);
  351. sleep(0);
  352. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement