Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $access_token = '';
- $api = 'https://api.telegram.org/bot' . $access_token;
- function sendPhotoId($chat_id, $file) {
- $target_url = $GLOBALS['api'] . '/sendphoto';
- $post = array(
- 'chat_id' => $chat_id,
- 'photo' => $file,
- );
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL,$target_url);
- curl_setopt($ch, CURLOPT_POST,1);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
- $result=curl_exec ($ch);
- curl_close ($ch);
- echo $result;
- return json_decode($result);
- }
- sendPhotoId(119416836, 'AgADBAADxgM2G9AeZAdbakWTRpBQMFZWoBkABNTKxG8eq8f1P3sAAgI');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement