Guest User

Untitled

a guest
Jan 4th, 2020
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.65 KB | None | 0 0
  1. #!/usr/local/bin/php
  2. <?php
  3.  
  4. function sendMessage($chat_id, $message) {
  5.     $access_token = '1005079398:HUYHUYHUY';
  6.     $api = 'https://api.telegram.org/bot' . $access_token;
  7.     //proxy auth
  8.     $auth = base64_encode('huy:peyzda');
  9.  
  10.     $aContext = array(
  11.     'http' => array(
  12.             'proxy' => 'tcp://123.123.123.123:8080',
  13.             'request_fulluri' => true,
  14.         'header' => "Proxy-Authorization: Basic $auth",
  15.     ),
  16.     );
  17.     $cxContext = stream_context_create($aContext);
  18.     file_get_contents($api . '/sendMessage?chat_id=' . $chat_id . '&text=' . urlencode($message) . '&parse_mode=html', False, $cxContext);
  19. }
  20.  
  21. sendMessage("-11111114","huy");
Advertisement
Add Comment
Please, Sign In to add comment