Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/local/bin/php
- <?php
- function sendMessage($chat_id, $message) {
- $access_token = '1005079398:HUYHUYHUY';
- $api = 'https://api.telegram.org/bot' . $access_token;
- //proxy auth
- $auth = base64_encode('huy:peyzda');
- $aContext = array(
- 'http' => array(
- 'proxy' => 'tcp://123.123.123.123:8080',
- 'request_fulluri' => true,
- 'header' => "Proxy-Authorization: Basic $auth",
- ),
- );
- $cxContext = stream_context_create($aContext);
- file_get_contents($api . '/sendMessage?chat_id=' . $chat_id . '&text=' . urlencode($message) . '&parse_mode=html', False, $cxContext);
- }
- sendMessage("-11111114","huy");
Advertisement
Add Comment
Please, Sign In to add comment