Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.48 KB | None | 0 0
  1. <?php
  2. date_default_timezone_set("Asia/Baghdad");
  3. if (!file_exists('madeline.php')) {
  4. copy('https://phar.madelineproto.xyz/madeline.php', 'madeline.php');
  5. }
  6. if (!file_exists('blockde.txt')) {
  7. file_put_contents('blockde.txt','');
  8. }
  9. if (!file_exists('list.txt')) {
  10. file_put_contents('list.txt','');
  11. }
  12. if (!file_exists('info.json')) {
  13. $info = [
  14. 'status' => false,
  15. 'type' => "m"
  16. ];
  17. file_put_contents('info.json',json_encode($info));
  18. }
  19. function curlGet($url) {
  20. $ch = curl_init();
  21. curl_setopt($ch,CURLOPT_URL,$url);
  22. curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
  23. curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 );
  24. $res = curl_exec($ch);
  25. return $res;
  26. }
  27. function random(){
  28. $out = "";
  29. $rand = substr(str_shuffle('ABCDEFGHIJKLMNOPQRSTUVWXYZ'), 0,1);
  30. $randomf = 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);
  31. $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');
  32.  
  33. $out="";
  34. for ($i = 0; $i < count($randomx); $i++) {
  35. $two = $rand;
  36. $one = $randomx[$i];
  37. $out = $out . $one.$two.$two.$two.$two.$two."\n";
  38. }
  39. for ($i = 0; $i < count($randomf); $i++) {
  40. $two = $rand;
  41. $one = $randomf[$i];
  42. $out = $out . $two.$two.$one.$two.$two.$two."\n";
  43. $out = $out . $two.$one.$two.$two.$two.$two."\n";
  44. $out = $out . $two.$two.$two.$one.$two.$two."\n";
  45. if($one != "_"){
  46. $out = $out . $two.$two.$two.$two.$two.$one."\n";
  47. }
  48. }
  49. $j = "bot";
  50. $ke = "_";
  51. for ($k = 0; $k < count($randomf); $k++) {
  52. $two = $rand;
  53. $one = $randomf[$k];
  54. $out = $out . $two.$two.$one.$j."\n";
  55. $out = $out . $two.$one.$two.$j."\n";
  56. $out = $out . $two.$ke.$one.$j."\n";
  57. $out = $out . $two.$one.$one.$j."\n";
  58. $out = $out . $two.$two.$ke.$j."\n";
  59. }
  60. return $out;
  61. }
  62. function Check($user){
  63. $get = curlGet('http://t.me/'.$user);
  64. if(!strpos($get,"tgme_page_extra")){
  65. return "Good";
  66. }else {
  67. return "Bad";
  68. }
  69. }
  70. include 'madeline.php';
  71.  
  72. $MadelineProto = new \danog\MadelineProto\API('me.madeline');
  73. $Admin = "@QWWVW";
  74. $MadelineProto->start();
  75. $offset = 0;
  76. $MadelineProto->messages->sendMessage(['peer'=>$Admin,'message'=>'🔘 Checker was turned on
  77.  
  78. ⚠ī¸ Command:
  79. 🛑 stop the Checker : /stop
  80. 🔃 Run the Checker : /run
  81. ℹī¸ informations : /info
  82.  
  83. 📝 For List or a make : /set l or /set m
  84. 📑 Set to List : /list Text
  85. 📑 Clear for List : /clean
  86. ==============
  87. 🔘 Admin : '.$Admin.'
  88. -']);
  89.  
  90. $channelsssso = $MadelineProto->channels->createChannel(['broadcast' => true, 'megagroup' => false, 'title' => "m", 'about' => "m" ]);
  91. $i=0;
  92. $date_start = date("m/d h:i:s a");
  93. while (true) {
  94.  
  95.  
  96.  
  97. if(file_exists('info.json')){
  98. $info = json_decode(file_get_contents('info.json'),true);
  99. if($info['status']){
  100.  
  101. if($info['type'] == "l"){
  102. $users = explode("\n",file_get_contents('list.txt'));
  103. }else{
  104. $users = explode("\n",random() );
  105. }
  106.  
  107. foreach($users as $user){
  108. $user = str_replace([" ","\r","\n"], '', $user);
  109. $blockde = explode("\n", file_get_contents('blockde.txt'));
  110. if(!in_array($user, $blockde)){
  111. $Check = Check($user);
  112. if($Check == "Good"){
  113. try {
  114. $MadelineProto->account->checkUsername(['username' => $user ]);
  115. $MadelineProto->channels->updateUsername(['channel' => $channelsssso['updates'][1], 'username' => $user ]);
  116. $date_end = date("m/d h:i:s a");
  117. $textsend = "▂▂▂▂▂▂▂▂▂▂▂
  118. ■|UserName: [ @$user ].!
  119. ■|The LooPs: [ $i ].!
  120. ■|Date Start: [ $date_start ].!
  121. ■|Date End: [ $date_end ].!";
  122. $MadelineProto->messages->sendMessage(['peer'=>$Admin,'message'=>$textsend]);
  123. $channelsssso = $MadelineProto->channels->createChannel(['broadcast' => true, 'megagroup' => false, 'title' => "m", 'about' => "m" ]);
  124. }catch(Exception $e){
  125. if($e->getMessage() == "The provided username is not valid" or $e->getMessage() == "USERNAME_OCCUPIED"){
  126. file_put_contents("blockde.txt", file_get_contents("blockde.txt")."$user\n");
  127. }else{
  128. $textsend = '@' . $user . ':'.$e->getMessage();
  129. $MadelineProto->messages->sendMessage(['peer'=>$Admin,'message'=>$textsend]);
  130. }
  131. }
  132. }
  133. $i++;
  134. usleep(250000);
  135. }
  136. }
  137.  
  138.  
  139.  
  140. }
  141. }
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148. $updates = $MadelineProto->get_updates(['offset' => $offset, 'limit' => 50, 'timeout' => 0]);
  149. if($updates != null) \danog\MadelineProto\Logger::log($updates);
  150. foreach ($updates as $update) {
  151. $offset = $update['update_id'] + 1;
  152. switch ($update['update']['_']) {
  153. case 'updateNewMessage':
  154. case 'updateNewChannelMessage':
  155. if (isset($update['update']['message']['out']) && $update['update']['message']['out']) {
  156. continue;
  157. }
  158. $res = json_encode($update, JSON_PRETTY_PRINT);
  159. if ($res == '') {
  160. $res = var_export($update, true);
  161. }try {
  162. if(isset($update['update']['message']['message'])){
  163. //------------------------------------------
  164. $text = $update['update']['message']['message'];
  165. $from_id = isset($update['update']['message']['from_id']) ? $update['update']['message']['from_id'] : null;
  166. if($from_id == 799598143){
  167.  
  168. if($text == '/stop'){
  169. $info = json_decode(file_get_contents('info.json'),true);
  170. $MadelineProto->messages->sendMessage(['peer' => $update['update'], 'message' => "Checker has been successfully stopped ✅", 'reply_to_msg_id' => $update['update']['message']['id']]);
  171. $info['status'] = false;
  172. file_put_contents('info.json',json_encode($info));
  173. }
  174. if($text == '/run'){
  175. $info = json_decode(file_get_contents('info.json'),true);
  176. $MadelineProto->messages->sendMessage(['peer' => $update['update'], 'message' => "Checker was turned on successfully ✅", 'reply_to_msg_id' => $update['update']['message']['id']]);
  177. $info['status'] = true;
  178. file_put_contents('info.json',json_encode($info));
  179. }
  180.  
  181. if(preg_match('/\/set .*/', $text)){
  182. $info = json_decode(file_get_contents('info.json'),true);
  183. $text = str_replace('/set ', '', $text);
  184. if($text == 'l') $MadelineProto->messages->sendMessage(['peer' => $update['update'], 'message' => 'The List was successfully selected ✅', 'reply_to_msg_id' => $update['update']['message']['id']]);
  185. if($text == 'm') $MadelineProto->messages->sendMessage(['peer' => $update['update'], 'message' => 'The Make was successfully selected ✅', 'reply_to_msg_id' => $update['update']['message']['id']]);
  186. $info['type'] = "$text";
  187. file_put_contents('info.json',json_encode($info));
  188. }
  189. if(preg_match('/\/list .*/', $text)){
  190. $text = str_replace('/list ', '', $text);
  191. $MadelineProto->messages->sendMessage(['peer' => $update['update'], 'message' => 'The List was successfully placed ✅', 'reply_to_msg_id' => $update['update']['message']['id']]);
  192. $list = str_replace("<br>","\n",$text);
  193. file_put_contents('list.txt',$list);
  194. }
  195.  
  196. if($text == '/clear'){
  197. $MadelineProto->messages->sendMessage(['peer' => $update['update'], 'message' => "The List was successfully deleted ✅", 'reply_to_msg_id' => $update['update']['message']['id']]);
  198. file_put_contents('list.txt','');
  199. }
  200. if($text == '/info'){
  201.  
  202. $info = json_decode(file_get_contents('info.json'),true);
  203. $statusg = $info['status'];
  204. $typeg = $info['type'];
  205. if($statusg){
  206. $status = "ON ✅";
  207. }else{
  208. $status = "OFF 🛑";
  209. }
  210. if($typeg == "l"){
  211. $type = "List 📑";
  212. }else{
  213. $type = "Make đŸ“Ļ";
  214. }
  215. $MadelineProto->messages->sendMessage(['peer' => $update['update'], 'message' => "ℹī¸ Information of Checker:-
  216. Status Checker : $status
  217. Type of Checker : $type
  218. -", 'reply_to_msg_id' => $update['update']['message']['id']]);
  219. }
  220. }
  221. //------------------------------------------
  222. }
  223. } catch (\danog\MadelineProto\RPCErrorException $e) {
  224. $MadelineProto->messages->sendMessage(['peer' => $Admin, 'message' => $e->getCode().': '.$e->getMessage().PHP_EOL.$e->getTraceAsString()]);
  225. }
  226. }
  227. }
  228. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement