Selasa, 30 April 2019

PHP Script Bot Otomatis WhatsTgram

PHP Script Bot Otomatis WhatsTgram

Contoh script bot otomatis Whatstgram menggunakan PHP

<?php
ini_set('default_charset', 'UTF-8');
require_once('../include/database.config.php');

$method = $_SERVER['REQUEST_METHOD'];

if($method == 'POST'){
$idinbox = $_REQUEST['idinbox'];
$from = $_REQUEST['from'];
$tanggal = $_REQUEST['tanggal'];
$pengirim = $_REQUEST['pengirim'];
$pengirim =  str_replace('pkiqf','+',$pengirim);
$pesan = utf8_encode($_REQUEST['pesan']);

if ($pesan == 1) {
$hasil = "Hai, apa kabar?";
} elseif ($pesan == 2) {
$hasil = "Salam kenal";
} else {
$hasil = "[x*x]🤖 tpc - Informasi 🤖[x*x][xbx][xbx]Maaf, perintah Anda [[ [x*x]". $pesan ."[x*x] ]] tidak dikenali oleh sistem kami.";
}

if ($from == "whatsapp") {
$sql = "INSERT INTO jbssms.outbox (Text,DestinationNumber,kirimwhatsapp,kirimtelegram) values ('" . $hasil . "', N'" . $pengirim . "', 0, 1);";
}

if ($from == "telegram") {
$sql = "INSERT INTO jbssms.outbox (Text,DestinationNumber,kirimwhatsapp,kirimtelegram) values ('" . $hasil . "', N'" . $pengirim . "', 1, 0);";
}

mysql_query($sql);

$updateQ = "UPDATE jbssms.inbox SET status=1 WHERE ID=".$idinbox;

mysql_query($updateQ);
}
else
{
echo "Method not allowed";
}

?>

Posting Komentar