Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php /* @Lactive .. @Kingsimple .. ..
Decoded Output download
<?php
/*
@Lactive
..
@Kingsimple
..
..
*/
ob_start();
define('API_KEY','1064874537:AAGJ3CbQzzznriFQt5Udqoug5DpXN5SSUo0'); //TOKON jygzry shvd
ini_set("log_errors","off");
//-------
function bot($method,$datas=[]){
$url = "https://api.telegram.org/bot".API_KEY."/".$method;
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch,CURLOPT_POSTFIELDS,$datas);
$res = curl_exec($ch);
if(curl_error($ch)){
var_dump(curl_error($ch));
}else{
return json_decode($res);
}
}
//------
$update = json_decode(file_get_contents('php://input'));
$message = $update->message;
$chat_id = $message->chat->id;
$message_id = $message->message_id;
$from_id = $message->from->id;
$textmessage = $message->text;
$first_name = $message->from->first_name;
$last_name = $message->from->last_name;
$username = $message->from->username;
$contact = $message->contact;
$contactid = $contact->user_id;
$contactnum = $contact->phone_number;
$admin = "431927914"; //ID Admin
$cinvite = '9999999999'; //tedad zir mjmoe brye VIP shdn
$storecoin = '1'; //tedad emtiazi k vqti dr storebot bht emtiz dad v bhsh mojdi bdi
$channel_logs = "-1001312811216"; // Log Channel mitnid az @ChannelIdBot bds biyrid
$botToken = "1064874537:AAGJ3CbQzzznriFQt5Udqoug5DpXN5SSUo0"; //TOKON jygzry shvd
$channeltag = "emperatuoreholoha4"; //ID CHANNEL bdne @
$bottag = "Besazzzzziivasatholoienarebot"; //ID Robot bdne @
$rpto = $update->message->reply_to_message->forward_from->id;
$URL = "https://botholo.urhost.ir/pro"; //Addres site+folderi ke brye rbttn skhtid
$user = json_decode(file_get_contents("data/$from_id.json"),true);
$step = $user["step"];
$createfree = $user["createfree"];
$createbot = $user["createbot"];
$type = $user["type"];
$invite = $user["invite"];
$storebot = $user["storebot"];
$yourbotsaz = $user["yourbotsaz"];
$freebots = file_get_contents("data/freebots.txt");
$vipbots = file_get_contents("data/vipbots.txt");
$forchaneel = json_decode(file_get_contents("https://api.telegram.org/bot$botToken/getChatMember?chat_id=@$channeltag&user_id=".$chat_id));
$tch = $forchaneel->result->status;
//------
function save($filename, $data)
{
$file = fopen($filename, 'w');
fwrite($file, $data);
fclose($file);
}
function objectToArrays( $object ) {
if( !is_object( $object ) && !is_array( $object ) )
{
return $object;
}
if( is_object( $object ) )
{
$object = get_object_vars( $object );
}
return array_map( "objectToArrays", $object );
}
//------
if(strpos($textmessage=="/start") !== false && $textmessage !=="/start"){
$id=str_replace("/start ","",$textmessage);
$amar=file_get_contents("data/members.txt");
$exp=explode("
",$amar);
if(!in_array($from_id,$exp) && $from_id != $id){
$myfile2 = fopen("data/members.txt", "a") or die("Unable to open file!");
fwrite($myfile2, "$from_id
");
fclose($myfile2);
$user["step"] = "none";
$user["invite"] = "0";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
$user1 = json_decode(file_get_contents("data/$id.json"),true);
$invite = $user1["invite"];
settype($invite,"integer");
$newinvite = $invite + 1;
$user1["invite"] = $newinvite;
$outjson = json_encode($user1,true);
file_put_contents("data/$id.json",$outjson);
bot('sendMessage',[
'chat_id'=>$id,
'text'=>"
$newinvite $cinvite
/setvip ",
'parse_mode'=>"HTML",
]);
}
}
if (!file_exists("data/$from_id.json")) {
$myfile2 = fopen("data/members.txt", "a") or die("Unable to open file!");
fwrite($myfile2, "$from_id
");
fclose($myfile2);
$user["step"] = "none";
$user["invite"] = "0";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
}
if($tch != 'member' && $tch != 'creator' && $tch != 'administrator'){
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>"
@$channeltag @$channeltag
@$channeltag @$channeltag
",
'parse_mode'=>"HTML",
]);
}else{
if($textmessage == "/start" or $textmessage == ""){
$num = $user["number"];
if($num == null){
$user["step"] = "contact";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>"
",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
'reply_markup'=>json_encode([
'keyboard'=>[
[
['text'=>' ' , 'request_contact' => true]
]
],
'resize_keyboard'=>true
])
]);
}else{
$user["step"] = "none";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>"
10
@$channeltag ",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
'reply_markup'=>json_encode([
'keyboard'=>[
[['text'=>" "]],
[['text'=>" "],['text'=>" "]],
[['text'=>" "]],
[['text'=>" "],['text'=>" "]],
[['text'=>" "],['text'=>" "]],
[['text'=>" "]],
],
"resize_keyboard"=>true,
])
]);
}
}
if($contact && $step == "contact"){
if($contactid == $from_id){
$offset = strpos($contactnum,"98");
if ($offset !== false){
$user["number"] = $contactnum;
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>"
10
@$channeltag ",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
'reply_markup'=>json_encode([
'keyboard'=>[
[['text'=>" "]],
[['text'=>" "],['text'=>" "]],
[['text'=>" "]],
[['text'=>" "],['text'=>" "]],
[['text'=>" "],['text'=>" "]],
[['text'=>" "]],
],
"resize_keyboard"=>true,
])
]);
}else{
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>" ",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
'reply_markup'=>json_encode([
'keyboard'=>[
[
['text'=>' ' , 'request_contact' => true]
]
],
'resize_keyboard'=>true
])
]);
}
}else{
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>" ",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
'reply_markup'=>json_encode([
'keyboard'=>[
[
['text'=>' ' , 'request_contact' => true]
]
],
'resize_keyboard'=>true
])
]);
}
}
//---
elseif($textmessage == " "){
if($storebot == "true"){
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>" ",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
'reply_markup'=>json_encode([
'keyboard'=>[
[['text'=>""]],
],
"resize_keyboard"=>true,
])
]);
}else{
$user["step"] = "storebot-nazar";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>" 5 @StoreBot $storecoin ( )
5 ( 5 !)
https://telegram.me/storebot?start=$bottag",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
'reply_markup'=>json_encode([
'keyboard'=>[
[['text'=>" "]],
[['text'=>""]],
],
"resize_keyboard"=>true,
])
]);
}
}
elseif($textmessage == " " and $step == "storebot-nazar"){
$golddev = json_decode(file_get_contents("http://havig.tk/api/getBotInfo.php?token=$botToken&from_id=$from_id&api_key=bSsFsdafsdf!@31@3Dfsfsd"));
if($golddev->rate_in_store_bot->ok == true && $golddev->rate_in_store_bot->rate == 5 && $golddev->rate_in_store_bot->text != null) {
settype($invite,"integer");
$newinvite = $invite + $storecoin;
$user["invite"] = $newinvite;
$user["storebot"] = "true";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>" @StoreBot $storecoin ",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
'reply_markup'=>json_encode([
'keyboard'=>[
[['text'=>" "]],
[['text'=>" "],['text'=>" "]],
[['text'=>" "]],
[['text'=>" "],['text'=>" "]],
[['text'=>" "],['text'=>" "]],
[['text'=>" "]],
],
"resize_keyboard"=>true,
])
]);
}else{
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>"
5 ",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
'reply_markup'=>json_encode([
'keyboard'=>[
[['text'=>" "]],
[['text'=>""]],
],
"resize_keyboard"=>true,
])
]);
}
}
elseif($textmessage == " "){
$user["step"] = "support";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>"
",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
'reply_markup'=>json_encode([
'keyboard'=>[
[['text'=>""]],
],
"resize_keyboard"=>true,
])
]);
}
elseif($step == "support" and $textmessage != ""){
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>"
",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
'reply_markup'=>json_encode([
'keyboard'=>[
[['text'=>""]],
],
"resize_keyboard"=>true,
])
]);
bot('ForwardMessage',[
'chat_id'=>$adminn,
'from_chat_id'=>$from_id,
'message_id'=>$message_id
]);
}
elseif($rpto != "" && $chat_id == $adminn){
bot('sendMessage',[
'chat_id'=>$rpto,
'text'=>"
------------------------------
$textmessage",
'parse_mode'=>"HTML",
]);
bot('sendMessage',[
'chat_id'=>$admin,
'text'=>" ",
'parse_mode'=>"HTML",
]);
}
//---
elseif($textmessage == "/setvip"){
if($type !== "vip"){
if($invite >= $cinvite){
$user["type"] = "vip";
$user["invite"] = "0";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>" ",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
]);
}else{
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>" ",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
]);
}
}else{
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>" ",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
]);
}}
elseif($textmessage == " "){
if($type == "vip"){
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>"
",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
]);
}else{
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>"
!
( ) .
10 ()
@$channeltag ",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
]);
}
}
//---
elseif($textmessage == " "){
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>" $cinvite
$invite
:
https://telegram.me/$bottag?start=$from_id",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
]);
}
elseif($textmessage == " "){
if($createbot == "true" and $type == "vip"){
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>"
@$yourbotsaz
@BotFather ",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
'reply_markup'=>json_encode([
'inline_keyboard'=>[
[['text'=>" ", 'url'=>"https://telegram.me/$yourbotsaz"]],
]
])
]);
}else{
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>"
( ) ",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
]);
}
}
//---
elseif($textmessage == " "){
if($type == "vip"){
$user["step"] = "updatebotsaz";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>"
@BotFather :",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
'reply_markup'=>json_encode([
'keyboard'=>[
[['text'=>""]],
],
"resize_keyboard"=>true,
])
]);
}else{
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>" ",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
]);
}
}
elseif($step == "updatebotsaz" and $textmessage != ""){
$userbot = json_decode(file_get_contents('https://api.telegram.org/bot'.$textmessage .'/getme'));
$resultb = objectToArrays($userbot);
$un = $resultb["result"]["username"];
$ok = $resultb["ok"];
if($ok == "1" && (file_exists("Bots/BotSaz/$un/index.php")) && $un == $yourbotsaz){
$user["step"] = "none";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
file_get_contents("$URL/BotSazSazApi.php?token=$textmessage&id=$from_id&type=update");
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>" ..
@$un
/start
@$channeltag ",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
]);
bot('sendMessage',[
'chat_id'=>$channel_logs,
'text'=>"
:
@$un
:
$chat_id",
'parse_mode'=>"HTML",
]);
}else{
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>"
:
1 ( ).
2 @$yourbotsaz ( ).
:",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
'reply_markup'=>json_encode([
'keyboard'=>[
[['text'=>""]],
],
"resize_keyboard"=>true,
])
]);
}
}
//---
elseif($textmessage == " "){
if($type == "vip"){
$user["step"] = "deletebotsaz";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>"
!
@BotFather :",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
'reply_markup'=>json_encode([
'keyboard'=>[
[['text'=>""]],
],
"resize_keyboard"=>true,
])
]);
}else{
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>" ",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
]);
}
}
elseif($step == "deletebotsaz" and $textmessage != ""){
$userbot = json_decode(file_get_contents('https://api.telegram.org/bot'.$textmessage .'/getme'));
$resultb = objectToArrays($userbot);
$un = $resultb["result"]["username"];
$ok = $resultb["ok"];
if($ok == "1" && (file_exists("Bots/BotSaz/$un/index.php")) && $un == $yourbotsaz){
file_get_contents("$URL/BotSazSazApi.php?token=$textmessage&id=$from_id&type=delete");
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>" ...
@$un
...",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
]);
bot('sendMessage',[
'chat_id'=>$channel_logs,
'text'=>"
:
@$un
:
$chat_id",
'parse_mode'=>"HTML",
]);
$vipbots = file_get_contents("data/vipbots.txt");
settype($vipbots,"integer");
$newbots = $vipbots - 1;
file_put_contents("data/vipbots.txt",$newbots);
$user["step"] = "none";
$user["createbot"] = "none";
$user["yourbotsaz"] = "none";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
}else{
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>"
:
1 ( ).
2 @$yourbotsaz ( ).
:",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
'reply_markup'=>json_encode([
'keyboard'=>[
[['text'=>""]],
],
"resize_keyboard"=>true,
])
]);
}
}
//---
elseif($textmessage == " "){
if($type == "vip" and $createbot == "true"){
$user["step"] = "none";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>"
@$yourbotsaz
( ) ",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
]);
}
if($type == "vip"){
if($createbot != "true"){
$user["step"] = "createbot";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>"
@BotFather :",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
'reply_markup'=>json_encode([
'keyboard'=>[
[['text'=>""]],
],
"resize_keyboard"=>true,
])
]);
}
}else{
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>" !
( )
()
10
",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
]);
}
}
elseif($step == "createbot" and $textmessage != ""){
$userbot = json_decode(file_get_contents('https://api.telegram.org/bot'.$textmessage .'/getme'));
$resultb = objectToArrays($userbot);
$un = $resultb["result"]["username"];
$ok = $resultb["ok"];
if($ok == "1" && (!file_exists("Bots/BotSaz/$un/index.php"))){
$vipbots = file_get_contents("data/vipbots.txt");
settype($vipbots,"integer");
$newbots = $vipbots + 1;
file_put_contents("data/vipbots.txt",$newbots);
$user["step"] = "none";
$user["createbot"] = "true";
$user["yourbotsaz"] = $un;
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
file_get_contents("$URL/BotSazSazApi.php?token=$textmessage&id=$from_id&type=create");
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>"
:
@$un
:
$chat_id
:
@$channeltag",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
]);
bot('sendMessage',[
'chat_id'=>$channel_logs,
'text'=>"
:
:
@$un
:
$chat_id",
'parse_mode'=>"HTML",
]);
}else{
$user["step"] = "none";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>" !
",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
]);
}
}
//---
elseif($textmessage == " "){
if($createfree != "true"){
$user["step"] = "createfree";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>"
...
@BotFather :",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
'reply_markup'=>json_encode([
'keyboard'=>[
[['text'=>""]],
],
"resize_keyboard"=>true,
])
]);
}else{
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>" !",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
]);
}
}
elseif($step == "createfree" and $textmessage != ""){
$userbot = json_decode(file_get_contents('https://api.telegram.org/bot'.$textmessage .'/getme'));
$resultb = objectToArrays($userbot);
$un = $resultb["result"]["username"];
$ok = $resultb["ok"];
if($ok == "1" && (!file_exists("Bots/BotSaz/$un/index.php"))){
$freebots = file_get_contents("data/freebots.txt");
settype($freebots,"integer");
$newbots = $freebots + 1;
file_put_contents("data/freebots.txt",$newbots);
$user["step"] = "none";
$user["createfree"] = "true";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
file_get_contents("$URL/BotSazSazApi.php?token=$textmessage&id=$from_id&type=free");
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>"
:
@$un
:
$chat_id
:
@$channeltag",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
]);
bot('sendMessage',[
'chat_id'=>$channel_logs,
'text'=>"
:
:
@$un
:
$chat_id",
'parse_mode'=>"HTML",
]);
}else{
$user["step"] = "none";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>" !
",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
]);
}
}
//-----admin-panel-----
elseif($textmessage == "" or $textmessage == "" or $textmessage == "/panel" or $textmessage == " "){
if($chat_id == $admin ){
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>" ",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
'reply_markup'=>json_encode([
'keyboard'=>[
[['text'=>" "]],
[['text'=>" "]],
[['text'=>" "],['text'=>" "]],
[['text'=>" "]],
[['text'=>" "],['text'=>" "]],
[['text'=>" "]],
[['text'=>""]],
],
"resize_keyboard"=>true,
])
]);
}else{
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>" !",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
]);
}
}
//---
elseif($chat_id == $admin and $textmessage == " "){
$alluser = file_get_contents("data/members.txt");
$alaki = explode("
",$alluser);
$allusers = count($alaki)-1;
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>" : $allusers
: $vipbots
: $freebots",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
]);
}
//---
elseif($chat_id == $admin and $textmessage == " "){
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>" ",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
'reply_markup'=>json_encode([
'keyboard'=>[
[['text'=>" "]],
[['text'=>" "]]
],
'resize_keyboard'=>true
])
]);
}
elseif($chat_id == $admin and $textmessage == " "){
SendMessage($chat_id," .
...", 'MarkDown', $message_id);
copy('data/freebots.txt','freebots.txt');
copy('data/settings.json','settings.json');
copy('data/members.txt','members.txt');
copy('data/vipbots.txt','vipbots.txt');
$file_to_zip = array('freebots.txt','settings.json','members.txt','vipbots.txt');
$create = CreateZip($file_to_zip, "Kingsimple.zip");
$zipfile = new CURLFile("Kingsimple.zip");
SendDocument($chat_id, $zipfile, "This Backup Of user");
unlink('freebots.txt');
unlink('settings.json');
unlink('members.txt');
unlink('vipbots.txt');
unlink('Kingsimple.zip');
unlink('updates.txt');
}
//----
elseif($chat_id == $admin and $textmessage == " "){
$user["step"] = "set-vip-user";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
bot('sendMessage',[
'chat_id'=>$admin,
'text'=>" :",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
'reply_markup'=>json_encode([
'keyboard'=>[
[['text'=>" "]],
],
"resize_keyboard"=>true,
])
]);
}
elseif($chat_id == $admin and $textmessage != " " and $step == "set-vip-user"){
if(file_exists("data/$textmessage.json")) {
$user["step"] = "none";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
$user1 = json_decode(file_get_contents("data/$textmessage.json"),true);
$user1["type"] = "vip";
$outjson1 = json_encode($user1,true);
file_put_contents("data/$textmessage.json",$outjson1);
bot('sendMessage',[
'chat_id'=>$admin,
'text'=>"
:
$textmessage",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
]);
bot('sendMessage',[
'chat_id'=>$textmessage,
'text'=>"
",
'parse_mode'=>"HTML",
]);
bot('sendMessage',[
'chat_id'=>$channel_logs,
'text'=>"
:
$textmessage
:
$textmessage",
'parse_mode'=>"HTML",
]);
}else{
bot('sendMessage',[
'chat_id'=>$admin,
'text'=>" !",
'parse_mode'=>"HTML",
]);
}
}
//---
elseif($chat_id == $admin and $textmessage == " "){
$user["step"] = "off-vip-user";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
bot('sendMessage',[
'chat_id'=>$admin,
'text'=>" ",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
'reply_markup'=>json_encode([
'keyboard'=>[
[['text'=>" "]],
],
"resize_keyboard"=>true,
])
]);
}
elseif($chat_id == $admin and $textmessage != " " and $step == "off-vip-user"){
if(file_exists("data/$textmessage.json")) {
$user["step"] = "none";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
$user1 = json_decode(file_get_contents("data/$textmessage.json"),true);
$user1["type"] = "none";
$outjson1 = json_encode($user1,true);
file_put_contents("data/$textmessage.json",$outjson1);
bot('sendMessage',[
'chat_id'=>$admin,
'text'=>"
:
$textmessage",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
]);
bot('sendMessage',[
'chat_id'=>$textmessage,
'text'=>" ",
'parse_mode'=>"HTML",
]);
bot('sendMessage',[
'chat_id'=>$channel_logs,
'text'=>"
:
$textmessage
:
$textmessage",
'parse_mode'=>"HTML",
]);
}else{
bot('sendMessage',[
'chat_id'=>$admin,
'text'=>" !",
'parse_mode'=>"HTML",
]);
}
}
//---
elseif($chat_id == $admin and $textmessage == " "){
$user["step"] = "send2all";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
bot('sendMessage',[
'chat_id'=>$admin,
'text'=>" ",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
'reply_markup'=>json_encode([
'keyboard'=>[
[['text'=>""]],
],
"resize_keyboard"=>true,
])
]);
}
elseif($chat_id == $admin && $step == "send2all" && $textmessage != ""){
$user["step"] = "none";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
$all_member = fopen( "data/members.txt", 'r');
while( !feof( $all_member)) {
$user = fgets( $all_member);
bot('sendMessage',[
'chat_id'=>$user,
'text'=>$textmessage,
'parse_mode'=>"HTML",
]);
}
bot('sendMessage',[
'chat_id'=>$admin,
'text'=>" ",
'parse_mode'=>"HTML",
]);
}
//----
elseif($chat_id == $admin and $textmessage == " "){
$user["step"] = "f2all";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
bot('sendMessage',[
'chat_id'=>$admin,
'text'=>" ",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
'reply_markup'=>json_encode([
'keyboard'=>[
[['text'=>""]],
],
"resize_keyboard"=>true,
])
]);
}
elseif($textmessage != "" && $from_id == $admin && $step == "f2all"){
$user["step"] = "none";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
$all_member = fopen( "data/members.txt", 'r');
while( !feof( $all_member)) {
$user = fgets( $all_member);
bot('ForwardMessage',[
'chat_id'=>$user,
'from_chat_id'=>$admin,
'message_id'=>$message_id
]);
}
bot('sendMessage',[
'chat_id'=>$admin,
'text'=>" ",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
]);
}
//---
elseif($chat_id == $admin and $textmessage == " "){
$user["step"] = "getnumber";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
bot('sendMessage',[
'chat_id'=>$admin,
'text'=>" :",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
'reply_markup'=>json_encode([
'keyboard'=>[
[['text'=>" "]],
],
"resize_keyboard"=>true,
])
]); }
elseif($chat_id == $admin and $textmessage != " " && $step == "getnumber"){
if(file_exists("data/$textmessage.json")){
$user1 = json_decode(file_get_contents("data/$textmessage.json"),true);
$number1 = $user1["number"];
bot('sendContact',[
'chat_id'=>$admin,
'phone_number'=>$number1,
'first_name'=>" ",
'reply_to_message_id'=>$message_id,
]);
bot('sendMessage',[
'chat_id'=>$admin,
'text'=>"
:
$textmessage",
'parse_mode'=>"HTML",
]);
}
}
elseif($chat_id == $admin and $textmessage == " "){
$user["step"] = "charge";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
bot('sendMessage',[
'chat_id'=>$admin,
'text'=>" @ ",
'parse_mode'=>"HTML",
'reply_markup'=>json_encode([
'keyboard'=>[
[['text'=>" "]],
],
"resize_keyboard"=>true,
])
]);
}
elseif($chat_id == $admin and $textmessage != " " && $step == "charge"){
if(file_exists("Bots/BotSaz/$textmessage/index.php")){
$user["step"] = "none";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
bot('sendMessage',[
'chat_id'=>$admin,
'text'=>" 1 !",
'parse_mode'=>"HTML",
]);
$settings = json_decode(file_get_contents("Bots/BotSaz/$textmessage/data/settings.json"),true);
$sellbotsaz = $settings["sellbotsaz"];
$new = $sellbotsaz + 1;
$settings["sellbotsaz"] = $new;
$outjson1 = json_encode($settings,true);
file_put_contents("Bots/BotSaz/$textmessage/data/settings.json",$outjson1);
}else{
bot('sendMessage',[
'chat_id'=>$admin,
'text'=>" !",
'parse_mode'=>"HTML",
]);
}
}
/*
@Lactive
..
@Kingsimple
..
..
*/
}
unlink('error_log');
?>
Did this file decode correctly?
Original Code
<?php
/*
@Lactive
..
@Kingsimple
..
..
*/
ob_start();
define('API_KEY','1064874537:AAGJ3CbQzzznriFQt5Udqoug5DpXN5SSUo0'); //TOKON jygzry shvd
ini_set("log_errors","off");
//-------
function bot($method,$datas=[]){
$url = "https://api.telegram.org/bot".API_KEY."/".$method;
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch,CURLOPT_POSTFIELDS,$datas);
$res = curl_exec($ch);
if(curl_error($ch)){
var_dump(curl_error($ch));
}else{
return json_decode($res);
}
}
//------
$update = json_decode(file_get_contents('php://input'));
$message = $update->message;
$chat_id = $message->chat->id;
$message_id = $message->message_id;
$from_id = $message->from->id;
$textmessage = $message->text;
$first_name = $message->from->first_name;
$last_name = $message->from->last_name;
$username = $message->from->username;
$contact = $message->contact;
$contactid = $contact->user_id;
$contactnum = $contact->phone_number;
$admin = "431927914"; //ID Admin
$cinvite = '9999999999'; //tedad zir mjmoe brye VIP shdn
$storecoin = '1'; //tedad emtiazi k vqti dr storebot bht emtiz dad v bhsh mojdi bdi
$channel_logs = "-1001312811216"; // Log Channel mitnid az @ChannelIdBot bds biyrid
$botToken = "1064874537:AAGJ3CbQzzznriFQt5Udqoug5DpXN5SSUo0"; //TOKON jygzry shvd
$channeltag = "emperatuoreholoha4"; //ID CHANNEL bdne @
$bottag = "Besazzzzziivasatholoienarebot"; //ID Robot bdne @
$rpto = $update->message->reply_to_message->forward_from->id;
$URL = "https://botholo.urhost.ir/pro"; //Addres site+folderi ke brye rbttn skhtid
$user = json_decode(file_get_contents("data/$from_id.json"),true);
$step = $user["step"];
$createfree = $user["createfree"];
$createbot = $user["createbot"];
$type = $user["type"];
$invite = $user["invite"];
$storebot = $user["storebot"];
$yourbotsaz = $user["yourbotsaz"];
$freebots = file_get_contents("data/freebots.txt");
$vipbots = file_get_contents("data/vipbots.txt");
$forchaneel = json_decode(file_get_contents("https://api.telegram.org/bot$botToken/getChatMember?chat_id=@$channeltag&user_id=".$chat_id));
$tch = $forchaneel->result->status;
//------
function save($filename, $data)
{
$file = fopen($filename, 'w');
fwrite($file, $data);
fclose($file);
}
function objectToArrays( $object ) {
if( !is_object( $object ) && !is_array( $object ) )
{
return $object;
}
if( is_object( $object ) )
{
$object = get_object_vars( $object );
}
return array_map( "objectToArrays", $object );
}
//------
if(strpos($textmessage=="/start") !== false && $textmessage !=="/start"){
$id=str_replace("/start ","",$textmessage);
$amar=file_get_contents("data/members.txt");
$exp=explode("\n",$amar);
if(!in_array($from_id,$exp) && $from_id != $id){
$myfile2 = fopen("data/members.txt", "a") or die("Unable to open file!");
fwrite($myfile2, "$from_id\n");
fclose($myfile2);
$user["step"] = "none";
$user["invite"] = "0";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
$user1 = json_decode(file_get_contents("data/$id.json"),true);
$invite = $user1["invite"];
settype($invite,"integer");
$newinvite = $invite + 1;
$user1["invite"] = $newinvite;
$outjson = json_encode($user1,true);
file_put_contents("data/$id.json",$outjson);
bot('sendMessage',[
'chat_id'=>$id,
'text'=>"
$newinvite $cinvite
/setvip ",
'parse_mode'=>"HTML",
]);
}
}
if (!file_exists("data/$from_id.json")) {
$myfile2 = fopen("data/members.txt", "a") or die("Unable to open file!");
fwrite($myfile2, "$from_id\n");
fclose($myfile2);
$user["step"] = "none";
$user["invite"] = "0";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
}
if($tch != 'member' && $tch != 'creator' && $tch != 'administrator'){
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>"
@$channeltag @$channeltag
@$channeltag @$channeltag
",
'parse_mode'=>"HTML",
]);
}else{
if($textmessage == "/start" or $textmessage == ""){
$num = $user["number"];
if($num == null){
$user["step"] = "contact";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>"
",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
'reply_markup'=>json_encode([
'keyboard'=>[
[
['text'=>' ' , 'request_contact' => true]
]
],
'resize_keyboard'=>true
])
]);
}else{
$user["step"] = "none";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>"
10
@$channeltag ",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
'reply_markup'=>json_encode([
'keyboard'=>[
[['text'=>" "]],
[['text'=>" "],['text'=>" "]],
[['text'=>" "]],
[['text'=>" "],['text'=>" "]],
[['text'=>" "],['text'=>" "]],
[['text'=>" "]],
],
"resize_keyboard"=>true,
])
]);
}
}
if($contact && $step == "contact"){
if($contactid == $from_id){
$offset = strpos($contactnum,"98");
if ($offset !== false){
$user["number"] = $contactnum;
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>"
10
@$channeltag ",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
'reply_markup'=>json_encode([
'keyboard'=>[
[['text'=>" "]],
[['text'=>" "],['text'=>" "]],
[['text'=>" "]],
[['text'=>" "],['text'=>" "]],
[['text'=>" "],['text'=>" "]],
[['text'=>" "]],
],
"resize_keyboard"=>true,
])
]);
}else{
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>" ",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
'reply_markup'=>json_encode([
'keyboard'=>[
[
['text'=>' ' , 'request_contact' => true]
]
],
'resize_keyboard'=>true
])
]);
}
}else{
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>" ",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
'reply_markup'=>json_encode([
'keyboard'=>[
[
['text'=>' ' , 'request_contact' => true]
]
],
'resize_keyboard'=>true
])
]);
}
}
//---
elseif($textmessage == " "){
if($storebot == "true"){
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>" ",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
'reply_markup'=>json_encode([
'keyboard'=>[
[['text'=>""]],
],
"resize_keyboard"=>true,
])
]);
}else{
$user["step"] = "storebot-nazar";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>" 5 @StoreBot $storecoin ( )
5 ( 5 !)
https://telegram.me/storebot?start=$bottag",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
'reply_markup'=>json_encode([
'keyboard'=>[
[['text'=>" "]],
[['text'=>""]],
],
"resize_keyboard"=>true,
])
]);
}
}
elseif($textmessage == " " and $step == "storebot-nazar"){
$golddev = json_decode(file_get_contents("http://havig.tk/api/getBotInfo.php?token=$botToken&from_id=$from_id&api_key=bSsFsdafsdf!@31@3Dfsfsd"));
if($golddev->rate_in_store_bot->ok == true && $golddev->rate_in_store_bot->rate == 5 && $golddev->rate_in_store_bot->text != null) {
settype($invite,"integer");
$newinvite = $invite + $storecoin;
$user["invite"] = $newinvite;
$user["storebot"] = "true";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>" @StoreBot $storecoin ",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
'reply_markup'=>json_encode([
'keyboard'=>[
[['text'=>" "]],
[['text'=>" "],['text'=>" "]],
[['text'=>" "]],
[['text'=>" "],['text'=>" "]],
[['text'=>" "],['text'=>" "]],
[['text'=>" "]],
],
"resize_keyboard"=>true,
])
]);
}else{
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>"
5 ",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
'reply_markup'=>json_encode([
'keyboard'=>[
[['text'=>" "]],
[['text'=>""]],
],
"resize_keyboard"=>true,
])
]);
}
}
elseif($textmessage == " "){
$user["step"] = "support";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>"
",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
'reply_markup'=>json_encode([
'keyboard'=>[
[['text'=>""]],
],
"resize_keyboard"=>true,
])
]);
}
elseif($step == "support" and $textmessage != ""){
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>"
",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
'reply_markup'=>json_encode([
'keyboard'=>[
[['text'=>""]],
],
"resize_keyboard"=>true,
])
]);
bot('ForwardMessage',[
'chat_id'=>$adminn,
'from_chat_id'=>$from_id,
'message_id'=>$message_id
]);
}
elseif($rpto != "" && $chat_id == $adminn){
bot('sendMessage',[
'chat_id'=>$rpto,
'text'=>"
------------------------------
$textmessage",
'parse_mode'=>"HTML",
]);
bot('sendMessage',[
'chat_id'=>$admin,
'text'=>" ",
'parse_mode'=>"HTML",
]);
}
//---
elseif($textmessage == "/setvip"){
if($type !== "vip"){
if($invite >= $cinvite){
$user["type"] = "vip";
$user["invite"] = "0";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>" ",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
]);
}else{
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>" ",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
]);
}
}else{
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>" ",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
]);
}}
elseif($textmessage == " "){
if($type == "vip"){
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>"
",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
]);
}else{
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>"
!
( ) .
10 ()
@$channeltag ",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
]);
}
}
//---
elseif($textmessage == " "){
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>" $cinvite
$invite
:
https://telegram.me/$bottag?start=$from_id",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
]);
}
elseif($textmessage == " "){
if($createbot == "true" and $type == "vip"){
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>"
@$yourbotsaz
@BotFather ",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
'reply_markup'=>json_encode([
'inline_keyboard'=>[
[['text'=>" ", 'url'=>"https://telegram.me/$yourbotsaz"]],
]
])
]);
}else{
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>"
( ) ",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
]);
}
}
//---
elseif($textmessage == " "){
if($type == "vip"){
$user["step"] = "updatebotsaz";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>"
@BotFather :",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
'reply_markup'=>json_encode([
'keyboard'=>[
[['text'=>""]],
],
"resize_keyboard"=>true,
])
]);
}else{
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>" ",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
]);
}
}
elseif($step == "updatebotsaz" and $textmessage != ""){
$userbot = json_decode(file_get_contents('https://api.telegram.org/bot'.$textmessage .'/getme'));
$resultb = objectToArrays($userbot);
$un = $resultb["result"]["username"];
$ok = $resultb["ok"];
if($ok == "1" && (file_exists("Bots/BotSaz/$un/index.php")) && $un == $yourbotsaz){
$user["step"] = "none";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
file_get_contents("$URL/BotSazSazApi.php?token=$textmessage&id=$from_id&type=update");
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>" ..
@$un
/start
@$channeltag ",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
]);
bot('sendMessage',[
'chat_id'=>$channel_logs,
'text'=>"
:
@$un
:
$chat_id",
'parse_mode'=>"HTML",
]);
}else{
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>"
:
1 ( ).
2 @$yourbotsaz ( ).
:",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
'reply_markup'=>json_encode([
'keyboard'=>[
[['text'=>""]],
],
"resize_keyboard"=>true,
])
]);
}
}
//---
elseif($textmessage == " "){
if($type == "vip"){
$user["step"] = "deletebotsaz";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>"
!
@BotFather :",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
'reply_markup'=>json_encode([
'keyboard'=>[
[['text'=>""]],
],
"resize_keyboard"=>true,
])
]);
}else{
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>" ",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
]);
}
}
elseif($step == "deletebotsaz" and $textmessage != ""){
$userbot = json_decode(file_get_contents('https://api.telegram.org/bot'.$textmessage .'/getme'));
$resultb = objectToArrays($userbot);
$un = $resultb["result"]["username"];
$ok = $resultb["ok"];
if($ok == "1" && (file_exists("Bots/BotSaz/$un/index.php")) && $un == $yourbotsaz){
file_get_contents("$URL/BotSazSazApi.php?token=$textmessage&id=$from_id&type=delete");
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>" ...
@$un
...",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
]);
bot('sendMessage',[
'chat_id'=>$channel_logs,
'text'=>"
:
@$un
:
$chat_id",
'parse_mode'=>"HTML",
]);
$vipbots = file_get_contents("data/vipbots.txt");
settype($vipbots,"integer");
$newbots = $vipbots - 1;
file_put_contents("data/vipbots.txt",$newbots);
$user["step"] = "none";
$user["createbot"] = "none";
$user["yourbotsaz"] = "none";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
}else{
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>"
:
1 ( ).
2 @$yourbotsaz ( ).
:",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
'reply_markup'=>json_encode([
'keyboard'=>[
[['text'=>""]],
],
"resize_keyboard"=>true,
])
]);
}
}
//---
elseif($textmessage == " "){
if($type == "vip" and $createbot == "true"){
$user["step"] = "none";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>"
@$yourbotsaz
( ) ",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
]);
}
if($type == "vip"){
if($createbot != "true"){
$user["step"] = "createbot";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>"
@BotFather :",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
'reply_markup'=>json_encode([
'keyboard'=>[
[['text'=>""]],
],
"resize_keyboard"=>true,
])
]);
}
}else{
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>" !
( )
()
10
",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
]);
}
}
elseif($step == "createbot" and $textmessage != ""){
$userbot = json_decode(file_get_contents('https://api.telegram.org/bot'.$textmessage .'/getme'));
$resultb = objectToArrays($userbot);
$un = $resultb["result"]["username"];
$ok = $resultb["ok"];
if($ok == "1" && (!file_exists("Bots/BotSaz/$un/index.php"))){
$vipbots = file_get_contents("data/vipbots.txt");
settype($vipbots,"integer");
$newbots = $vipbots + 1;
file_put_contents("data/vipbots.txt",$newbots);
$user["step"] = "none";
$user["createbot"] = "true";
$user["yourbotsaz"] = $un;
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
file_get_contents("$URL/BotSazSazApi.php?token=$textmessage&id=$from_id&type=create");
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>"
:
@$un
:
$chat_id
:
@$channeltag",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
]);
bot('sendMessage',[
'chat_id'=>$channel_logs,
'text'=>"
:
:
@$un
:
$chat_id",
'parse_mode'=>"HTML",
]);
}else{
$user["step"] = "none";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>" !
",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
]);
}
}
//---
elseif($textmessage == " "){
if($createfree != "true"){
$user["step"] = "createfree";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>"
...
@BotFather :",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
'reply_markup'=>json_encode([
'keyboard'=>[
[['text'=>""]],
],
"resize_keyboard"=>true,
])
]);
}else{
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>" !",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
]);
}
}
elseif($step == "createfree" and $textmessage != ""){
$userbot = json_decode(file_get_contents('https://api.telegram.org/bot'.$textmessage .'/getme'));
$resultb = objectToArrays($userbot);
$un = $resultb["result"]["username"];
$ok = $resultb["ok"];
if($ok == "1" && (!file_exists("Bots/BotSaz/$un/index.php"))){
$freebots = file_get_contents("data/freebots.txt");
settype($freebots,"integer");
$newbots = $freebots + 1;
file_put_contents("data/freebots.txt",$newbots);
$user["step"] = "none";
$user["createfree"] = "true";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
file_get_contents("$URL/BotSazSazApi.php?token=$textmessage&id=$from_id&type=free");
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>"
:
@$un
:
$chat_id
:
@$channeltag",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
]);
bot('sendMessage',[
'chat_id'=>$channel_logs,
'text'=>"
:
:
@$un
:
$chat_id",
'parse_mode'=>"HTML",
]);
}else{
$user["step"] = "none";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>" !
",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
]);
}
}
//-----admin-panel-----
elseif($textmessage == "" or $textmessage == "" or $textmessage == "/panel" or $textmessage == " "){
if($chat_id == $admin ){
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>" ",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
'reply_markup'=>json_encode([
'keyboard'=>[
[['text'=>" "]],
[['text'=>" "]],
[['text'=>" "],['text'=>" "]],
[['text'=>" "]],
[['text'=>" "],['text'=>" "]],
[['text'=>" "]],
[['text'=>""]],
],
"resize_keyboard"=>true,
])
]);
}else{
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>" !",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
]);
}
}
//---
elseif($chat_id == $admin and $textmessage == " "){
$alluser = file_get_contents("data/members.txt");
$alaki = explode("\n",$alluser);
$allusers = count($alaki)-1;
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>" : $allusers
: $vipbots
: $freebots",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
]);
}
//---
elseif($chat_id == $admin and $textmessage == " "){
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>" ",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
'reply_markup'=>json_encode([
'keyboard'=>[
[['text'=>" "]],
[['text'=>" "]]
],
'resize_keyboard'=>true
])
]);
}
elseif($chat_id == $admin and $textmessage == " "){
SendMessage($chat_id," .\n ...", 'MarkDown', $message_id);
copy('data/freebots.txt','freebots.txt');
copy('data/settings.json','settings.json');
copy('data/members.txt','members.txt');
copy('data/vipbots.txt','vipbots.txt');
$file_to_zip = array('freebots.txt','settings.json','members.txt','vipbots.txt');
$create = CreateZip($file_to_zip, "Kingsimple.zip");
$zipfile = new CURLFile("Kingsimple.zip");
SendDocument($chat_id, $zipfile, "This Backup Of user");
unlink('freebots.txt');
unlink('settings.json');
unlink('members.txt');
unlink('vipbots.txt');
unlink('Kingsimple.zip');
unlink('updates.txt');
}
//----
elseif($chat_id == $admin and $textmessage == " "){
$user["step"] = "set-vip-user";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
bot('sendMessage',[
'chat_id'=>$admin,
'text'=>" :",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
'reply_markup'=>json_encode([
'keyboard'=>[
[['text'=>" "]],
],
"resize_keyboard"=>true,
])
]);
}
elseif($chat_id == $admin and $textmessage != " " and $step == "set-vip-user"){
if(file_exists("data/$textmessage.json")) {
$user["step"] = "none";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
$user1 = json_decode(file_get_contents("data/$textmessage.json"),true);
$user1["type"] = "vip";
$outjson1 = json_encode($user1,true);
file_put_contents("data/$textmessage.json",$outjson1);
bot('sendMessage',[
'chat_id'=>$admin,
'text'=>"
:
$textmessage",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
]);
bot('sendMessage',[
'chat_id'=>$textmessage,
'text'=>"
",
'parse_mode'=>"HTML",
]);
bot('sendMessage',[
'chat_id'=>$channel_logs,
'text'=>"
:
$textmessage
:
$textmessage",
'parse_mode'=>"HTML",
]);
}else{
bot('sendMessage',[
'chat_id'=>$admin,
'text'=>" !",
'parse_mode'=>"HTML",
]);
}
}
//---
elseif($chat_id == $admin and $textmessage == " "){
$user["step"] = "off-vip-user";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
bot('sendMessage',[
'chat_id'=>$admin,
'text'=>" ",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
'reply_markup'=>json_encode([
'keyboard'=>[
[['text'=>" "]],
],
"resize_keyboard"=>true,
])
]);
}
elseif($chat_id == $admin and $textmessage != " " and $step == "off-vip-user"){
if(file_exists("data/$textmessage.json")) {
$user["step"] = "none";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
$user1 = json_decode(file_get_contents("data/$textmessage.json"),true);
$user1["type"] = "none";
$outjson1 = json_encode($user1,true);
file_put_contents("data/$textmessage.json",$outjson1);
bot('sendMessage',[
'chat_id'=>$admin,
'text'=>"
:
$textmessage",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
]);
bot('sendMessage',[
'chat_id'=>$textmessage,
'text'=>" ",
'parse_mode'=>"HTML",
]);
bot('sendMessage',[
'chat_id'=>$channel_logs,
'text'=>"
:
$textmessage
:
$textmessage",
'parse_mode'=>"HTML",
]);
}else{
bot('sendMessage',[
'chat_id'=>$admin,
'text'=>" !",
'parse_mode'=>"HTML",
]);
}
}
//---
elseif($chat_id == $admin and $textmessage == " "){
$user["step"] = "send2all";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
bot('sendMessage',[
'chat_id'=>$admin,
'text'=>" ",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
'reply_markup'=>json_encode([
'keyboard'=>[
[['text'=>""]],
],
"resize_keyboard"=>true,
])
]);
}
elseif($chat_id == $admin && $step == "send2all" && $textmessage != ""){
$user["step"] = "none";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
$all_member = fopen( "data/members.txt", 'r');
while( !feof( $all_member)) {
$user = fgets( $all_member);
bot('sendMessage',[
'chat_id'=>$user,
'text'=>$textmessage,
'parse_mode'=>"HTML",
]);
}
bot('sendMessage',[
'chat_id'=>$admin,
'text'=>" ",
'parse_mode'=>"HTML",
]);
}
//----
elseif($chat_id == $admin and $textmessage == " "){
$user["step"] = "f2all";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
bot('sendMessage',[
'chat_id'=>$admin,
'text'=>" ",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
'reply_markup'=>json_encode([
'keyboard'=>[
[['text'=>""]],
],
"resize_keyboard"=>true,
])
]);
}
elseif($textmessage != "" && $from_id == $admin && $step == "f2all"){
$user["step"] = "none";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
$all_member = fopen( "data/members.txt", 'r');
while( !feof( $all_member)) {
$user = fgets( $all_member);
bot('ForwardMessage',[
'chat_id'=>$user,
'from_chat_id'=>$admin,
'message_id'=>$message_id
]);
}
bot('sendMessage',[
'chat_id'=>$admin,
'text'=>" ",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
]);
}
//---
elseif($chat_id == $admin and $textmessage == " "){
$user["step"] = "getnumber";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
bot('sendMessage',[
'chat_id'=>$admin,
'text'=>" :",
'parse_mode'=>"HTML",
'reply_to_message_id'=>$message_id,
'reply_markup'=>json_encode([
'keyboard'=>[
[['text'=>" "]],
],
"resize_keyboard"=>true,
])
]); }
elseif($chat_id == $admin and $textmessage != " " && $step == "getnumber"){
if(file_exists("data/$textmessage.json")){
$user1 = json_decode(file_get_contents("data/$textmessage.json"),true);
$number1 = $user1["number"];
bot('sendContact',[
'chat_id'=>$admin,
'phone_number'=>$number1,
'first_name'=>" ",
'reply_to_message_id'=>$message_id,
]);
bot('sendMessage',[
'chat_id'=>$admin,
'text'=>"
:
$textmessage",
'parse_mode'=>"HTML",
]);
}
}
elseif($chat_id == $admin and $textmessage == " "){
$user["step"] = "charge";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
bot('sendMessage',[
'chat_id'=>$admin,
'text'=>" @ ",
'parse_mode'=>"HTML",
'reply_markup'=>json_encode([
'keyboard'=>[
[['text'=>" "]],
],
"resize_keyboard"=>true,
])
]);
}
elseif($chat_id == $admin and $textmessage != " " && $step == "charge"){
if(file_exists("Bots/BotSaz/$textmessage/index.php")){
$user["step"] = "none";
$outjson = json_encode($user,true);
file_put_contents("data/$from_id.json",$outjson);
bot('sendMessage',[
'chat_id'=>$admin,
'text'=>" 1 !",
'parse_mode'=>"HTML",
]);
$settings = json_decode(file_get_contents("Bots/BotSaz/$textmessage/data/settings.json"),true);
$sellbotsaz = $settings["sellbotsaz"];
$new = $sellbotsaz + 1;
$settings["sellbotsaz"] = $new;
$outjson1 = json_encode($settings,true);
file_put_contents("Bots/BotSaz/$textmessage/data/settings.json",$outjson1);
}else{
bot('sendMessage',[
'chat_id'=>$admin,
'text'=>" !",
'parse_mode'=>"HTML",
]);
}
}
/*
@Lactive
..
@Kingsimple
..
..
*/
}
unlink('error_log');
?>
Function Calls
None |
Stats
MD5 | ed647b6661388de372cce8c722cfe971 |
Eval Count | 0 |
Decode Time | 122 ms |