Answer the question
In order to leave comments, you need to log in
Uploading pictures by telegram bot?
task: the user writes a message with a picture in the bot, you need to return the same message to the bot (publish on behalf of the bot)
I can’t send pictures, how to do it?
Answer the question
In order to leave comments, you need to log in
$bot_url = "Ваш бот";
$url = $bot_url . "sendPhoto?chat_id=Ваш чат ID" ;
$post_fields = array('chat_id' => $chat_id, 'photo' => new CURLFile(realpath($path1)) );
$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPHEADER, array( "Content-Type:multipart/form-data" ));
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_fields);
$output = curl_exec($ch);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question