<?php

$api = "bot6327641207:AAELatpXpZ33Dnvg5Xj1T9UsYChJfSgZaXU"; 

$input = file_get_contents("php://input");
$update = json_decode($input, true);
date_default_timezone_set('Asia/Ho_Chi_Minh');


$firstName = $update["message"]["from"]["first_name"]?$update["message"]["from"]["first_name"]:"user";
$lastName = $update["message"]["from"]["last_name"]?$update["message"]["from"]["last_name"]:"";
$fullName = $firstName." ".$lastName;

$Mensagem = $update['message']['text'];
$chatid = $update['message']['chat']['id'];

function sendMessage($chatid, $text)
{
global $api;
$url = "https://api.telegram.org/$api/sendMessage?chat_id=".$chatid."&parse_mode=HTML&text=".urlencode($text);
$get = file_get_contents($url);

}
$DetectaComando = substr($Mensagem, 0 ,1);
error_reporting(0);
$ch = curl_init();
$url = "https://bot.iskorpion.com/check.php?id=".$chatid;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
$result = strip_tags($result);
curl_close($ch);
    

    
    if ($result == 'RESELLER')
    {
        if ($DetectaComando == '/')
        {
            if ( preg_match("~\bstart\b~",$Mensagem) == true )
            {
                sendMessage($chatid, "Hey Admin! $fullName
				Commands:
				/reg15h - Register ramdisk Hello
				/reg15p - Register Ramdisk Passcode
				/rem15h - Remove ramdisk Hello
				/rem15p - Remove ramdisk Passcode
				/check15h - Check ramdisk Hello
				/check15p - Check Ramdisk Passcode
				/reggsm - Register iOS 12-14 GSM Signal
				/regmeid - Register iOS 12 - 14 Meid No Signal
				/remgsm - Remove iOS 12-14 GSM
				/remmeid - Remove iOS 12-14 Meid
				/checkgsm - Check iOS 12-14 GSM
				/checkmeid - Check iOS 12-14 Meid
				/reg12p - Register iOS 12 - 14 Passcode
				/rem12p - Remove iOS 12 - 14 passcode
				/check12p - Check iOS 12 - 14 Passcode
				/regaccount - Register Account Removal
				/checkaccount - Check Account
				/remaccount - delete account
				/reg12bb - Register Broken Baseband
				/check12bb - Check Broken Baseband
				/rem12bb - Delete Broken Baseband
				/mdmreg - Register MDM
				/mdmrem - Remove MDM
				/mdmcheck - Check MDM
				/regfmi - Register Proxy FMI OFF
				/remfmi - Delete Proxy FMI OFF
				/checkfmi - Check if FMI OFF Porxy Registered
				");	
            }
else if (preg_match("~\bstart2\b~",$Mensagem) )
            {
                sendMessage($chatid, "Hey Admin! $fullName
				how are you?");	
            }
        
            else if ( preg_match("~\breg15h\b~",$Mensagem) == true )
            {
                $imei1 = explode(' ', $Mensagem);
	            $imei = $imei1[1] ;
	            $firstName = $update["message"]["from"]["first_name"]?$update["message"]["from"]["first_name"]:"user";
	            $lastName = $update["message"]["from"]["last_name"]?$update["message"]["from"]["last_name"]:"";
	            $fullName = $firstName." ".$lastName;
	            if (empty($imei)) 
	            {   
	                sendMessage($chatid, "Example: /reg15h 0x000ca123456780");  
	            
			    }
			    else 
			    { 
			        sendMessage($chatid, "Processing ...");
	                $ch = curl_init();
	                $url = "https://api.iskorpion.com/api.php?reg=".$imei."&service=3";
	                curl_setopt($ch, CURLOPT_URL, $url);
	                curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	                $result = curl_exec($ch);
	                $result = strip_tags($result);
	                curl_close($ch);   
	                sendMessage($chatid, $result);
			        
			    }
		    }
		    else if ( preg_match("~\bcheck15h\b~",$Mensagem) == true )
		    {
		        $imei1 = explode(' ', $Mensagem);
	            $imei = $imei1[1] ;
	
	            $firstName = $update["message"]["from"]["first_name"]?$update["message"]["from"]["first_name"]:"user";
	            $lastName = $update["message"]["from"]["last_name"]?$update["message"]["from"]["last_name"]:"";
	            $fullName = $firstName." ".$lastName;
	            if (empty($imei)) 
	            {   
	                sendMessage($chatid, "Example: /check15h 0x01234564acbc");  
	                
	            }
	            else 
	            {  
	                sendMessage($chatid, "Processing ...");
	                $ch = curl_init();
	                $url = "https://api.iskorpion.com/api.php?ecid=".$imei."&service=3";
	                curl_setopt($ch, CURLOPT_URL, $url);
	                curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	                $result = curl_exec($ch);
	                $result = strip_tags($result);
	                curl_close($ch);   
	                sendMessage($chatid, $result);
	                
	            }
		    }
		    else if ( preg_match("~\brem15h\b~",$Mensagem) == true )
		    {
		        $imei1 = explode(' ', $Mensagem);
	            $imei = $imei1[1] ;
	            $firstName = $update["message"]["from"]["first_name"]?$update["message"]["from"]["first_name"]:"user";
	            $lastName = $update["message"]["from"]["last_name"]?$update["message"]["from"]["last_name"]:"";
	            $fullName = $firstName." ".$lastName;
	            if (empty($imei)) {   sendMessage($chatid, "Example: /rem15h 0x000a123a123a123");  
			
			 }
			 else
			 {
			     sendMessage($chatid, "Processing ...");
	             $ch = curl_init();
	             $url = "https://api.iskorpion.com/api.php?del=".$imei."&service=3";
	            curl_setopt($ch, CURLOPT_URL, $url);
	            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	            $result = curl_exec($ch);
	            $result = strip_tags($result);
	            curl_close($ch);
	            sendMessage($chatid, $result);
			     
			 }
		        
		  }


		  else if ( preg_match("~\breg15p\b~",$Mensagem) == true )
		  {
			  $imei1 = explode(' ', $Mensagem);
			  $imei = $imei1[1] ;
			  $firstName = $update["message"]["from"]["first_name"]?$update["message"]["from"]["first_name"]:"user";
			  $lastName = $update["message"]["from"]["last_name"]?$update["message"]["from"]["last_name"]:"";
			  $fullName = $firstName." ".$lastName;
			  if (empty($imei)) 
			  {   
				  sendMessage($chatid, "Example: /reg15p 0x000ca123456780");  
			  
			  }
			  else 
			  { 
				  sendMessage($chatid, "Processing ...");
				  $ch = curl_init();
				  $url = "https://api.iskorpion.com/api.php?reg=".$imei."&service=2";
				  curl_setopt($ch, CURLOPT_URL, $url);
				  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
				  $result = curl_exec($ch);
				  $result = strip_tags($result);
				  curl_close($ch);   
				  sendMessage($chatid, $result);
				  
			  }
		  }
		  else if ( preg_match("~\bcheck15p\b~",$Mensagem) == true )
		  {
			  $imei1 = explode(' ', $Mensagem);
			  $imei = $imei1[1] ;
  
			  $firstName = $update["message"]["from"]["first_name"]?$update["message"]["from"]["first_name"]:"user";
			  $lastName = $update["message"]["from"]["last_name"]?$update["message"]["from"]["last_name"]:"";
			  $fullName = $firstName." ".$lastName;
			  if (empty($imei)) 
			  {   
				  sendMessage($chatid, "Example: /check15p 0x01234564acbc");  
				  
			  }
			  else 
			  {  
				  sendMessage($chatid, "Processing ...");
				  $ch = curl_init();
				  $url = "https://api.iskorpion.com/api.php?ecid=".$imei."&service=2";
				  curl_setopt($ch, CURLOPT_URL, $url);
				  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
				  $result = curl_exec($ch);
				  $result = strip_tags($result);
				  curl_close($ch);   
				  sendMessage($chatid, $result);
				  
			  }
		  }
		  else if ( preg_match("~\brem15p\b~",$Mensagem) == true )
		  {
			  $imei1 = explode(' ', $Mensagem);
			  $imei = $imei1[1] ;
			  $firstName = $update["message"]["from"]["first_name"]?$update["message"]["from"]["first_name"]:"user";
			  $lastName = $update["message"]["from"]["last_name"]?$update["message"]["from"]["last_name"]:"";
			  $fullName = $firstName." ".$lastName;
			  if (empty($imei)) {   sendMessage($chatid, "Example: /rem15p 0x000a123a123a123");  
		  
		   }
		   else
		   {
			   sendMessage($chatid, "Processing ...");
			   $ch = curl_init();
			   $url = "https://api.iskorpion.com/api.php?del=".$imei."&service=2";
			  curl_setopt($ch, CURLOPT_URL, $url);
			  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
			  $result = curl_exec($ch);
			  $result = strip_tags($result);
			  curl_close($ch);
			  sendMessage($chatid, $result);
			   
		   }
			  
		}




		 
		  else if ( preg_match("~\breggsm\b~",$Mensagem) == true )
            {
                $imei1 = explode(' ', $Mensagem);
	            $imei = $imei1[1] ;
	            $firstName = $update["message"]["from"]["first_name"]?$update["message"]["from"]["first_name"]:"user";
	            $lastName = $update["message"]["from"]["last_name"]?$update["message"]["from"]["last_name"]:"";
	            $fullName = $firstName." ".$lastName;
	            if (empty($imei)) 
	            {   
	                sendMessage($chatid, "Example: /reggsm F17M0U5C43T0AN");  
	            
			    }
			    else 
			    { 
			        sendMessage($chatid, "Processing ...");
	                $ch = curl_init();
	                $url = "https://api.iskorpion.com/api.php?reg=".$imei."&service=5";
	                curl_setopt($ch, CURLOPT_URL, $url);
	                curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	                $result = curl_exec($ch);
	                $result = strip_tags($result);
	                curl_close($ch);   
	                sendMessage($chatid, $result);
			        
			    }
		    }
		    else if ( preg_match("~\bcheckgsm\b~",$Mensagem) == true )
		    {
		        $imei1 = explode(' ', $Mensagem);
	            $imei = $imei1[1] ;
	
	            $firstName = $update["message"]["from"]["first_name"]?$update["message"]["from"]["first_name"]:"user";
	            $lastName = $update["message"]["from"]["last_name"]?$update["message"]["from"]["last_name"]:"";
	            $fullName = $firstName." ".$lastName;
	            if (empty($imei)) 
	            {   
	                sendMessage($chatid, "Example: /checkgsm F17M0U5C43T0AN");  
	                
	            }
	            else 
	            {  
	                sendMessage($chatid, "Processing ...");
	                $ch = curl_init();
	                $url = "https://api.iskorpion.com/api.php?ecid=".$imei."&service=5";
	                curl_setopt($ch, CURLOPT_URL, $url);
	                curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	                $result = curl_exec($ch);
	                $result = strip_tags($result);
	                curl_close($ch);   
	                sendMessage($chatid, $result);
	                
	            }
		    }
		    else if ( preg_match("~\bremgsm\b~",$Mensagem) == true )
		    {
		        $imei1 = explode(' ', $Mensagem);
	            $imei = $imei1[1] ;
	            $firstName = $update["message"]["from"]["first_name"]?$update["message"]["from"]["first_name"]:"user";
	            $lastName = $update["message"]["from"]["last_name"]?$update["message"]["from"]["last_name"]:"";
	            $fullName = $firstName." ".$lastName;
	            if (empty($imei)) {   sendMessage($chatid, "Example: /remgsm F17M0U5C43T0AN");  
			
			 }
			 else
			 {
			     sendMessage($chatid, "Processing ...");
	             $ch = curl_init();
	             $url = "https://api.iskorpion.com/api.php?del=".$imei."&service=5";
	            curl_setopt($ch, CURLOPT_URL, $url);
	            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	            $result = curl_exec($ch);
	            $result = strip_tags($result);
	            curl_close($ch);
	            sendMessage($chatid, $result);
			     
			 }
		        
		  }



		  else if ( preg_match("~\bregmeid\b~",$Mensagem) == true )
		  {
			  $imei1 = explode(' ', $Mensagem);
			  $imei = $imei1[1] ;
			  $firstName = $update["message"]["from"]["first_name"]?$update["message"]["from"]["first_name"]:"user";
			  $lastName = $update["message"]["from"]["last_name"]?$update["message"]["from"]["last_name"]:"";
			  $fullName = $firstName." ".$lastName;
			  if (empty($imei)) 
			  {   
				  sendMessage($chatid, "Example: /regmeid F17M0U5C43T0AN");  
			  
			  }
			  else 
			  { 
				  sendMessage($chatid, "Processing ...");
				  $ch = curl_init();
				  $url = "https://api.iskorpion.com/api.php?reg=".$imei."&service=8";
				  curl_setopt($ch, CURLOPT_URL, $url);
				  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
				  $result = curl_exec($ch);
				  $result = strip_tags($result);
				  curl_close($ch);   
				  sendMessage($chatid, $result);
				  
			  }
		  }
		  else if ( preg_match("~\bcheckmeid\b~",$Mensagem) == true )
		  {
			  $imei1 = explode(' ', $Mensagem);
			  $imei = $imei1[1] ;
  
			  $firstName = $update["message"]["from"]["first_name"]?$update["message"]["from"]["first_name"]:"user";
			  $lastName = $update["message"]["from"]["last_name"]?$update["message"]["from"]["last_name"]:"";
			  $fullName = $firstName." ".$lastName;
			  if (empty($imei)) 
			  {   
				  sendMessage($chatid, "Example: /checkmeid F17M0U5C43T0AN");  
				  
			  }
			  else 
			  {  
				  sendMessage($chatid, "Processing ...");
				  $ch = curl_init();
				  $url = "https://api.iskorpion.com/api.php?ecid=".$imei."&service=8";
				  curl_setopt($ch, CURLOPT_URL, $url);
				  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
				  $result = curl_exec($ch);
				  $result = strip_tags($result);
				  curl_close($ch);   
				  sendMessage($chatid, $result);
				  
			  }
		  }
		  else if ( preg_match("~\bremmeid\b~",$Mensagem) == true )
		  {
			  $imei1 = explode(' ', $Mensagem);
			  $imei = $imei1[1] ;
			  $firstName = $update["message"]["from"]["first_name"]?$update["message"]["from"]["first_name"]:"user";
			  $lastName = $update["message"]["from"]["last_name"]?$update["message"]["from"]["last_name"]:"";
			  $fullName = $firstName." ".$lastName;
			  if (empty($imei)) {   sendMessage($chatid, "Example: /remmeid F17M0U5C43T0AN");  
		  
		   }
		   else
		   {
			   sendMessage($chatid, "Processing ...");
			   $ch = curl_init();
			   $url = "https://api.iskorpion.com/api.php?del=".$imei."&service=8";
			  curl_setopt($ch, CURLOPT_URL, $url);
			  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
			  $result = curl_exec($ch);
			  $result = strip_tags($result);
			  curl_close($ch);
			  sendMessage($chatid, $result);
			   
		   }
			  
		}



		else if ( preg_match("~\breg12p\b~",$Mensagem) == true )
		{
			$imei1 = explode(' ', $Mensagem);
			$imei = $imei1[1] ;
			$firstName = $update["message"]["from"]["first_name"]?$update["message"]["from"]["first_name"]:"user";
			$lastName = $update["message"]["from"]["last_name"]?$update["message"]["from"]["last_name"]:"";
			$fullName = $firstName." ".$lastName;
			if (empty($imei)) 
			{   
				sendMessage($chatid, "Example: /reg12p F17M0U5C43T0AN");  
			
			}
			else 
			{ 
				sendMessage($chatid, "Processing ...");
				$ch = curl_init();
				$url = "https://api.iskorpion.com/api.php?reg=".$imei."&service=6";
				curl_setopt($ch, CURLOPT_URL, $url);
				curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
				$result = curl_exec($ch);
				$result = strip_tags($result);
				curl_close($ch);   
				sendMessage($chatid, $result);
				
			}
		}
		else if ( preg_match("~\bcheck12p\b~",$Mensagem) == true )
		{
			$imei1 = explode(' ', $Mensagem);
			$imei = $imei1[1] ;

			$firstName = $update["message"]["from"]["first_name"]?$update["message"]["from"]["first_name"]:"user";
			$lastName = $update["message"]["from"]["last_name"]?$update["message"]["from"]["last_name"]:"";
			$fullName = $firstName." ".$lastName;
			if (empty($imei)) 
			{   
				sendMessage($chatid, "Example: /check12p F17M0U5C43T0AN");  
				
			}
			else 
			{  
				sendMessage($chatid, "Processing ...");
				$ch = curl_init();
				$url = "https://api.iskorpion.com/api.php?ecid=".$imei."&service=6";
				curl_setopt($ch, CURLOPT_URL, $url);
				curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
				$result = curl_exec($ch);
				$result = strip_tags($result);
				curl_close($ch);   
				sendMessage($chatid, $result);
				
			}
		}
		else if ( preg_match("~\brem12p\b~",$Mensagem) == true )
		{
			$imei1 = explode(' ', $Mensagem);
			$imei = $imei1[1] ;
			$firstName = $update["message"]["from"]["first_name"]?$update["message"]["from"]["first_name"]:"user";
			$lastName = $update["message"]["from"]["last_name"]?$update["message"]["from"]["last_name"]:"";
			$fullName = $firstName." ".$lastName;
			if (empty($imei)) {   sendMessage($chatid, "Example: /rem12p F17M0U5C43T0AN");  
		
		 }
		 else
		 {
			 sendMessage($chatid, "Processing ...");
			 $ch = curl_init();
			 $url = "https://api.iskorpion.com/api.php?del=".$imei."&service=6";
			curl_setopt($ch, CURLOPT_URL, $url);
			curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
			$result = curl_exec($ch);
			$result = strip_tags($result);
			curl_close($ch);
			sendMessage($chatid, $result);
			 
		 }
			
	  }



	  else if ( preg_match("~\bregaccount\b~",$Mensagem) == true )
            {
                $imei1 = explode(' ', $Mensagem);
	            $imei = $imei1[1] ;
	            $firstName = $update["message"]["from"]["first_name"]?$update["message"]["from"]["first_name"]:"user";
	            $lastName = $update["message"]["from"]["last_name"]?$update["message"]["from"]["last_name"]:"";
	            $fullName = $firstName." ".$lastName;
	            if (empty($imei)) 
	            {   
	                sendMessage($chatid, "Example: /regaccount F17M0U5C43T0AN");  
	            
			    }
			    else 
			    { 
			        sendMessage($chatid, "Processing ...");
	                $ch = curl_init();
	                $url = "https://api.iskorpion.com/api.php?reg=".$imei."&service=9";
	                curl_setopt($ch, CURLOPT_URL, $url);
	                curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	                $result = curl_exec($ch);
	                $result = strip_tags($result);
	                curl_close($ch);   
	                sendMessage($chatid, $result);
			        
			    }
		    }
		    else if ( preg_match("~\bcheckaccount\b~",$Mensagem) == true )
		    {
		        $imei1 = explode(' ', $Mensagem);
	            $imei = $imei1[1] ;
	
	            $firstName = $update["message"]["from"]["first_name"]?$update["message"]["from"]["first_name"]:"user";
	            $lastName = $update["message"]["from"]["last_name"]?$update["message"]["from"]["last_name"]:"";
	            $fullName = $firstName." ".$lastName;
	            if (empty($imei)) 
	            {   
	                sendMessage($chatid, "Example: /checkaccount F17M0U5C43T0AN");  
	                
	            }
	            else 
	            {  
	                sendMessage($chatid, "Processing ...");
	                $ch = curl_init();
	                $url = "https://api.iskorpion.com/api.php?ecid=".$imei."&service=9";
	                curl_setopt($ch, CURLOPT_URL, $url);
	                curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	                $result = curl_exec($ch);
	                $result = strip_tags($result);
	                curl_close($ch);   
	                sendMessage($chatid, $result);
	                
	            }
		    }
		    else if ( preg_match("~\bremaccount\b~",$Mensagem) == true )
		    {
		        $imei1 = explode(' ', $Mensagem);
	            $imei = $imei1[1] ;
	            $firstName = $update["message"]["from"]["first_name"]?$update["message"]["from"]["first_name"]:"user";
	            $lastName = $update["message"]["from"]["last_name"]?$update["message"]["from"]["last_name"]:"";
	            $fullName = $firstName." ".$lastName;
	            if (empty($imei)) {   sendMessage($chatid, "Example: /remaccount F17M0U5C43T0AN");  
			
			 }
			 else
			 {
			     sendMessage($chatid, "Processing ...");
	             $ch = curl_init();
	             $url = "https://api.iskorpion.com/api.php?del=".$imei."&service=9";
	            curl_setopt($ch, CURLOPT_URL, $url);
	            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	            $result = curl_exec($ch);
	            $result = strip_tags($result);
	            curl_close($ch);
	            sendMessage($chatid, $result);
			     
			 }
		        
		  }



		  else if ( preg_match("~\bmdmreg\b~",$Mensagem) == true )
            {
                $imei1 = explode(' ', $Mensagem);
	            $imei = $imei1[1] ;
	            $firstName = $update["message"]["from"]["first_name"]?$update["message"]["from"]["first_name"]:"user";
	            $lastName = $update["message"]["from"]["last_name"]?$update["message"]["from"]["last_name"]:"";
	            $fullName = $firstName." ".$lastName;
	            if (empty($imei)) 
	            {   
	                sendMessage($chatid, "Example: /mdmreg F17M0U5C43T0AN");  
	            
			    }
			    else 
			    { 
			        sendMessage($chatid, "Processing ...");
	                $ch = curl_init();
	                $url = "https://api.iskorpion.com/api.php?reg=".$imei."&service=4";
	                curl_setopt($ch, CURLOPT_URL, $url);
	                curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	                $result = curl_exec($ch);
	                $result = strip_tags($result);
	                curl_close($ch);   
	                sendMessage($chatid, $result);
			        
			    }
		    }
		    else if ( preg_match("~\bmdmcheck\b~",$Mensagem) == true )
		    {
		        $imei1 = explode(' ', $Mensagem);
	            $imei = $imei1[1] ;
	
	            $firstName = $update["message"]["from"]["first_name"]?$update["message"]["from"]["first_name"]:"user";
	            $lastName = $update["message"]["from"]["last_name"]?$update["message"]["from"]["last_name"]:"";
	            $fullName = $firstName." ".$lastName;
	            if (empty($imei)) 
	            {   
	                sendMessage($chatid, "Example: /mdmcheck F17M0U5C43T0AN");  
	                
	            }
	            else 
	            {  
	                sendMessage($chatid, "Processing ...");
	                $ch = curl_init();
	                $url = "https://api.iskorpion.com/api.php?ecid=".$imei."&service=4";
	                curl_setopt($ch, CURLOPT_URL, $url);
	                curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	                $result = curl_exec($ch);
	                $result = strip_tags($result);
	                curl_close($ch);   
	                sendMessage($chatid, $result);
	                
	            }
		    }
		    else if ( preg_match("~\bmdmrem\b~",$Mensagem) == true )
		    {
		        $imei1 = explode(' ', $Mensagem);
	            $imei = $imei1[1] ;
	            $firstName = $update["message"]["from"]["first_name"]?$update["message"]["from"]["first_name"]:"user";
	            $lastName = $update["message"]["from"]["last_name"]?$update["message"]["from"]["last_name"]:"";
	            $fullName = $firstName." ".$lastName;
	            if (empty($imei)) {   sendMessage($chatid, "Example: /mdmrem F17M0U5C43T0AN");  
			
			 }
			 else
			 {
			     sendMessage($chatid, "Processing ...");
	             $ch = curl_init();
	             $url = "https://api.iskorpion.com/api.php?del=".$imei."&service=4";
	            curl_setopt($ch, CURLOPT_URL, $url);
	            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	            $result = curl_exec($ch);
	            $result = strip_tags($result);
	            curl_close($ch);
	            sendMessage($chatid, $result);
			     
			 }
		        
		  }


   else if ( preg_match("~\bregfmi\b~",$Mensagem) == true )
		    {
		        $imei1 = explode(' ', $Mensagem);
	            $imei = $imei1[1] ;
	            $firstName = $update["message"]["from"]["first_name"]?$update["message"]["from"]["first_name"]:"user";
	            $lastName = $update["message"]["from"]["last_name"]?$update["message"]["from"]["last_name"]:"";
	            $fullName = $firstName." ".$lastName;
	            if (empty($imei)) {   sendMessage($chatid, "Example: /regfmi f17mous@gmail.com");  
			
			 }
			 else
			 {
			     sendMessage($chatid, "Processing ...");
	             $ch = curl_init();
	             $url = "https://api.iskorpion.com/api.php?reg=".$imei."&service=25";
	            curl_setopt($ch, CURLOPT_URL, $url);
	            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	            $result = curl_exec($ch);
	            $result = strip_tags($result);
	            curl_close($ch);
	            sendMessage($chatid, $result);
			     
			 }
		        
		  }
            

   else if ( preg_match("~\bremfmi\b~",$Mensagem) == true )
		    {
		        $imei1 = explode(' ', $Mensagem);
	            $imei = $imei1[1] ;
	            $firstName = $update["message"]["from"]["first_name"]?$update["message"]["from"]["first_name"]:"user";
	            $lastName = $update["message"]["from"]["last_name"]?$update["message"]["from"]["last_name"]:"";
	            $fullName = $firstName." ".$lastName;
	            if (empty($imei)) {   sendMessage($chatid, "Example: /remfmi f17mous@gmail.com");  
			
			 }
			 else
			 {
			     sendMessage($chatid, "Processing ...");
	             $ch = curl_init();
	             $url = "https://api.iskorpion.com/api.php?del=".$imei."&service=25";
	            curl_setopt($ch, CURLOPT_URL, $url);
	            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	            $result = curl_exec($ch);
	            $result = strip_tags($result);
	            curl_close($ch);
	            sendMessage($chatid, $result);
			     
			 }
		        
		  }

   else if ( preg_match("~\bcheckfmi\b~",$Mensagem) == true )
		    {
		        $imei1 = explode(' ', $Mensagem);
	            $imei = $imei1[1] ;
	            $firstName = $update["message"]["from"]["first_name"]?$update["message"]["from"]["first_name"]:"user";
	            $lastName = $update["message"]["from"]["last_name"]?$update["message"]["from"]["last_name"]:"";
	            $fullName = $firstName." ".$lastName;
	            if (empty($imei)) {   sendMessage($chatid, "Example: /checkfmi f17mous@gmail.com");  
			
			 }
			 else
			 {
			     sendMessage($chatid, "Processing ...");
	             $ch = curl_init();
	             $url = "https://api.iskorpion.com/api.php?ecid=".$imei."&service=25";
	            curl_setopt($ch, CURLOPT_URL, $url);
	            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	            $result = curl_exec($ch);
	            $result = strip_tags($result);
	            curl_close($ch);
	            sendMessage($chatid, $result);
			     
			 }
		        
		  }

            
        }
        
    }
    else
    {
        sendMessage($chatid, "You do not have Permissions to use this BOT contact @Shetouane to register chat id!\niD: $chatid\n");	
        
    }
    
    
    
    
    
    
    
    
    
    
    
    ?>