Untitled

 avatar
unknown
plain_text
2 years ago
1.5 kB
2
Indexable
<?php
    $staff_username = 'lucyferr_777';
    $chat_id_for_errors = '745177525';
    $staff_in_bot = file_get_contents('https://api.telegram.org/bot5607746543:AAFGt6jUwsdMDPCkQaEuwMy6wPPufYW7mP0/getUpdates');
    $staff_in_bot = utf8_encode($staff_in_bot);
    $staff_in_bot = json_decode($staff_in_bot);
    for($i = 0;$i<count($staff_in_bot->result);$i++){
      if(is_object($staff_in_bot->result[$i]) && property_exists($staff_in_bot->result[$i],'my_chat_member')){
          if($staff_in_bot->result[$i]->my_chat_member->chat->username == $staff_username){
              $chat_id = $staff_in_bot->result[$i]->my_chat_member->chat->id;
              break;
          }else{
              $chat_id = $chat_id_for_errors;
          }
      }
    }
    $order_id = 12;
    $area = 'Zona centrala, Masa 5';
   
  $apiToken = "5607746543:AAFGt6jUwsdMDPCkQaEuwMy6wPPufYW7mP0";
  $data = [
      'chat_id' => $chat_id,
      'text' =>
'📢 Comandă nouă cu nr '.$order_id.
'
📌 '.$area.
'
⏲️ Ora: '. date("h:i:sa") . ' 📅Data: '.date("d-m-Y").'
🔗 https://glowskin.md/',
  ];
  $response = file_get_contents("https://api.telegram.org/bot$apiToken/sendMessage?" .http_build_query($data) );

  $data = [
    'chat_id' => $chat_id,
    'text' => '==============================',
  ];
  $response = file_get_contents("https://api.telegram.org/bot$apiToken/sendMessage?" .http_build_query($data) );
  

?>
Editor is loading...