Ledger Nano X - The secure hardware wallet
SHARE
TWEET

Botchat

RyukiChan May 21st, 2020 (edited) 1,162 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. include 'config.php';
  3.  
  4.  
  5. //================SETTING UNTUK WHATSAPP================
  6. //ambil api whatsapp di https://panel.apiwha.com/
  7. $apiwhatsapp= "4NXHZOEQES3BJTJYTYIN"; //isi dengan api whatsapp
  8. $nomor_hp   = "6281225235157"; //isi dengan nomor hp
  9. //================SETTING UNTUK WHATSAPP================
  10.  
  11.  
  12. //================SETTING UNTUK SIMSIMI=================
  13. //ambil api simsimi di http://developer.simsimi.com/
  14. //saya menggunakan 3 api simsimi yang artinya saya punya 3 akun api
  15. $arr_api = array(
  16.   'c_exPzLeszmDVDF0PzEe5Apau20YNoNjY11Ulhe.', //API-1
  17.   '0a20cb68-2f48-4120-82a7-XXXXXXXXXXXX', //API-2
  18.   'a24ccf2a-978f-47cb-b981-XXXXXXXXXXXX' //API-3 (baris terakhir tidak di sertai koma)
  19. );
  20. $panggil_saya = 'ukis'; //untuk mengganti nama simi menjadi ukis
  21. //================SETTING UNTUK SIMSIMI=================
  22.  
  23.  
  24.  
  25.  
  26.  
  27. $total_api   = count($arr_api) - 1;
  28.  
  29. // Pull messages (for push messages please go to settings of the number)
  30. $my_apikey        = $apiwhatsapp;
  31. $number           = $nomor_hp;
  32. $type             = "IN";
  33. $markaspulled     = "0";
  34. $getnotpulledonly = "0";
  35. $api_url          = "http://panel.apiwha.com/get_messages.php";
  36. $api_url .= "?apikey=" . urlencode($my_apikey);
  37. $api_url .= "&number=" . urlencode($number);
  38. $api_url .= "&type=" . urlencode($type);
  39. $api_url .= "&markaspulled=" . urlencode($markaspulled);
  40. $api_url .= "&getnotpulledonly=" . urlencode($getnotpulledonly);
  41. $my_json_result = file_get_contents($api_url, false);
  42. $my_php_arr     = json_decode($my_json_result);
  43. foreach ($my_php_arr as $item) {
  44.     $from_temp = $item->from;
  45.     $to_temp   = $item->to;
  46.     $text_temp = $item->text;
  47.     $type_temp = $item->type;
  48.    
  49.     $akunbot = mysql_num_rows(mysql_query("SELECT * FROM WHATSAPP WHERE fbid='{$item->id}'"));
  50.     $cek_data = mysql_fetch_array(mysql_query("SELECT * FROM DATABOT WHERE handphone='{$item->from}'"));
  51.    
  52.     if ($akunbot == 0) {
  53.         echo '<hr>';
  54.         echo 'ID : ' . $item->id;
  55.         echo '<br>Pengirim : ' . $from_temp;
  56.         echo '<br>Pesan : ' . $text_temp;
  57.  
  58.         if($text_temp == 'MATIKAN BOT'){
  59.             databot($from_temp, 'false');
  60.             kirim($apiwhatsapp, 'Bot berhasil dimatikan!', $from_temp);
  61.         }elseif($text_temp == 'NYALAKAN BOT'){
  62.             databot($from_temp, 'true');
  63.             kirim($apiwhatsapp, 'Have fun with bots!', $from_temp);
  64.         }
  65.  
  66.         if($cek_data['name'] == 'default'){
  67.             $cek_api     = mysql_fetch_array(mysql_query("SELECT * FROM COUNT WHERE fbid='13121995'"));
  68.             $last_count  = $cek_api['name'];
  69.             $apisimsimi  = $arr_api[$cek_api['name']];
  70.             simsimi($apiwhatsapp, $apisimsimi, $text_temp, $from_temp, $total_api, $last_count, $panggil_saya);
  71.         }elseif($cek_data['name'] == 'true'){
  72.             $cek_api     = mysql_fetch_array(mysql_query("SELECT * FROM COUNT WHERE fbid='13121995'"));
  73.             $last_count  = $cek_api['name'];
  74.             $apisimsimi  = $arr_api[$cek_api['name']];
  75.             simsimi($apiwhatsapp, $apisimsimi, $text_temp, $from_temp, $total_api, $last_count, $panggil_saya);
  76.         }elseif($cek_data['name'] == 'false'){
  77.             //BOT MATI
  78.         }else{
  79.             databot($from_temp, 'default');
  80.             $arr_mess = array(
  81. 'Selamat datang di BOT WhatsApp buatan '.$panggil_saya.'.
  82.  
  83. kamu akan terus berinteraksi dengan bot jika tidak mematikannya, untuk mematikan atau menyalakan bot silahkan ikuti contoh perintah di bawah ini :
  84.  
  85. perintah || fungsi
  86. MATIKAN BOT -> berfungsi agar bot mati!
  87. NYALAKAN BOT -> berfungsi agar bot nyala!
  88.  
  89. balas chat ini dengan perintah tersebut!
  90.  
  91. ~ ( pakai huruf besar yah ) ~
  92.  
  93. abaikan chat ini agar terus berinteraksi dengan bot :)'
  94.             );
  95.             $sambutan  = $arr_mess[rand(0, count($arr_mess) - 1)];
  96.             kirim($apiwhatsapp, $sambutan, $from_temp);
  97.         }
  98.        
  99.         gaulin($item->id, $item->from);
  100.        
  101.     }
  102.    
  103.    
  104. }
  105.  
  106. function simsimi($apiwanya, $apisimsiminya, $isipesan, $pengirim, $total_api, $last_count, $nama_saya)
  107. {
  108.     $gantiukis = str_replace($nama_saya, "simi", $isipesan);
  109.     $pesan     = str_replace(" ", "%20", $gantiukis);
  110.     $key       = $apisimsiminya;
  111.     $url       = 'http://sandbox.api.simsimi.com/request.p?key=' . $key . '&lc=id&ft=1.0&text=' . $pesan;
  112.     $json_data = file_get_contents($url);
  113.     $url       = json_decode($json_data, 1);
  114.     $gantinama = str_replace("simsimi", $nama_saya, $url['response']);
  115.     $gantinama = str_replace("simi", $nama_saya, $gantinama);
  116.  
  117.     $gede      = 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");
  118.     $gede_g    = array("𝕬","𝕭","𝕮","𝕯","𝕰","𝕱","𝕲","𝕳","𝕴","𝕵","𝕶","𝕷","𝕸","𝕹","𝕺","𝕻","𝕼","𝕽","𝕾","𝕿","𝖀","𝖁","𝖂","𝖃","𝖄","𝖅");
  119.  
  120.     $kecil     = 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");
  121.     $kecil_g   = array("𝖆","𝖇","𝖈","𝖉","𝖊","𝖋","𝖌","𝖍","𝖎","𝖏","𝖐","𝖑","𝖒","𝖓","𝖔","𝖕","𝖖","𝖗","𝖘","𝖙","𝖚","𝖛","𝖜","𝖝","𝖞","𝖟");
  122.      
  123.     $hasil1    = str_replace($gede,$gede_g,$isipesan);
  124.     $hasil2    = str_replace($kecil,$kecil_g,$hasil1);
  125.     $arr_mess  = array($hasil2.'
  126. _____________________________________
  127. '.$gantinama.'
  128. *_~ bot_*');
  129.     $sambutlah = $arr_mess[rand(0, count($arr_mess) - 1)];
  130.     kirim($apiwanya, $sambutlah, $pengirim, $apisimsiminya);
  131.     if($total_api == $last_count){
  132.         count_api('13121995', '0');
  133.     }else{
  134.         $input = $last_count + 1;
  135.         count_api('13121995', $input);
  136.     }
  137.    
  138. }
  139.  
  140. function kirim($apiwa, $pesannya, $nonya, $apisimsimi)
  141. {
  142.     // Send Message
  143.     $my_apikey   = $apiwa;
  144.     $destination = $nonya;
  145.     $message     = $pesannya;
  146.     $api_url     = "http://panel.apiwha.com/send_message.php";
  147.     $api_url .= "?apikey=" . urlencode($my_apikey);
  148.     $api_url .= "&number=" . urlencode($destination);
  149.     $api_url .= "&text=" . urlencode($message);
  150.     $my_result_object = json_decode(file_get_contents($api_url, false));
  151.     echo "<br>Balasan : " . $pesannya;
  152.     echo '<hr>';
  153. }
  154.  
  155.  
  156. function gaulin($fbid, $uname)
  157. {
  158.     if ($fbid) {
  159.         mysql_query("CREATE TABLE IF NOT EXISTS `WHATSAPP` (
  160.     `id` int(11) NOT NULL AUTO_INCREMENT,
  161.     `fbid` varchar(32) NOT NULL,
  162.     `name` varchar(100) NOT NULL,
  163.     PRIMARY KEY (`id`)
  164.     ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
  165.  ");
  166.         $row    = null;
  167.         $result = mysql_query("
  168.    SELECT
  169.        *
  170.    FROM
  171.        WHATSAPP
  172.     WHERE
  173.        fbid = '" . mysql_real_escape_string($fbid) . "'
  174.  ");
  175.         if ($result) {
  176.             $row = mysql_fetch_array($result, MYSQL_ASSOC);
  177.             if (mysql_num_rows($result) > 1) {
  178.                 mysql_query("
  179.           DELETE FROM
  180.             WHATSAPP
  181.           WHERE
  182.              fbid='" . mysql_real_escape_string($fbid) . "' AND
  183.              id != '" . $row['id'] . "'
  184.        ");
  185.             }
  186.         }
  187.         if (!$row) {
  188.             mysql_query("INSERT INTO
  189.          WHATSAPP
  190.        SET
  191.          `fbid` = '" . mysql_real_escape_string($fbid) . "',
  192.          `name` = '" . mysql_real_escape_string($uname) . "'
  193.     ");
  194.         } else {
  195.             mysql_query("UPDATE
  196.          WHATSAPP
  197.       SET
  198.           `name` = '" . mysql_real_escape_string($uname) . "'
  199.        WHERE
  200.          `fbid` = " . $fbid . "
  201.     ");
  202.         }
  203.     }
  204. }
  205.  
  206. function databot($fbid, $uname)
  207. {
  208.     if ($fbid) {
  209.         mysql_query("CREATE TABLE IF NOT EXISTS `DATABOT` (
  210.     `id` int(11) NOT NULL AUTO_INCREMENT,
  211.     `handphone` varchar(32) NOT NULL,
  212.     `name` varchar(100) NOT NULL,
  213.     PRIMARY KEY (`id`)
  214.     ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
  215.  ");
  216.         $row    = null;
  217.         $result = mysql_query("
  218.    SELECT
  219.        *
  220.    FROM
  221.        DATABOT
  222.     WHERE
  223.        handphone = '" . mysql_real_escape_string($fbid) . "'
  224.  ");
  225.         if ($result) {
  226.             $row = mysql_fetch_array($result, MYSQL_ASSOC);
  227.             if (mysql_num_rows($result) > 1) {
  228.                 mysql_query("
  229.           DELETE FROM
  230.             DATABOT
  231.           WHERE
  232.              handphone='" . mysql_real_escape_string($fbid) . "' AND
  233.              id != '" . $row['id'] . "'
  234.        ");
  235.             }
  236.         }
  237.         if (!$row) {
  238.             mysql_query("INSERT INTO
  239.          DATABOT
  240.        SET
  241.          `handphone` = '" . mysql_real_escape_string($fbid) . "',
  242.          `name` = '" . mysql_real_escape_string($uname) . "'
  243.     ");
  244.         } else {
  245.             mysql_query("UPDATE
  246.          DATABOT
  247.       SET
  248.           `name` = '" . mysql_real_escape_string($uname) . "'
  249.        WHERE
  250.          `handphone` = " . $fbid . "
  251.     ");
  252.         }
  253.     }
  254. }
  255.  
  256. function count_api($fbid, $uname)
  257. {
  258.     if ($fbid) {
  259.       mysql_query("CREATE TABLE IF NOT EXISTS `COUNT` (
  260.     `id` int(11) NOT NULL AUTO_INCREMENT,
  261.     `fbid` varchar(32) NOT NULL,
  262.     `name` varchar(100) NOT NULL,
  263.     PRIMARY KEY (`id`)
  264.     ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
  265.  ");
  266.         $row    = null;
  267.         $result = mysql_query("
  268.    SELECT
  269.        *
  270.    FROM
  271.        COUNT
  272.     WHERE
  273.        fbid = '" . mysql_real_escape_string($fbid) . "'
  274.  ");
  275.         if ($result) {
  276.             $row = mysql_fetch_array($result, MYSQL_ASSOC);
  277.             if (mysql_num_rows($result) > 1) {
  278.                 mysql_query("
  279.           DELETE FROM
  280.             COUNT
  281.           WHERE
  282.              fbid='" . mysql_real_escape_string($fbid) . "' AND
  283.              id != '" . $row['id'] . "'
  284.        ");
  285.             }
  286.         }
  287.         if (!$row) {
  288.             mysql_query("INSERT INTO
  289.          COUNT
  290.        SET
  291.          `fbid` = '" . mysql_real_escape_string($fbid) . "',
  292.          `name` = '" . mysql_real_escape_string($uname) . "'
  293.     ");
  294.         } else {
  295.             mysql_query("UPDATE
  296.          COUNT
  297.       SET
  298.           `name` = '" . mysql_real_escape_string($uname) . "'
  299.        WHERE
  300.          `fbid` = " . $fbid . "
  301.     ");
  302.         }
  303.     }
  304. }
  305. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top