We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
3.5.0
EditMessageMedia method doesn't work.
I've tried with this code:
$editMessageMedia = new EditMessageMedia(); $editMessageMedia->chat_id = "@channelname" $editMessageMedia->message_id = $message_id; $photo = new Photo(); $photo->media = "https://my-host/image.png" $photo->caption = "A caption"; $photo->parse_mode = "Markdown"; $editMessageMedia->media = $photo; $promise = $tgLog->performApiRequest($editMessageMedia); $promise->then( function () { }, function (\Exception $exception) { error_log($exception->getMessage()); } ); $loop->run();
But it always fails with the error: "Bad Request: can't parse InputMedia: Media is not specified".
With the same parameters the classic POST call to telegram api with a JSON body works fine.
$boturl = "https://api.telegram.org/bot".TELEGRAM_BOT_KEY."/editMessageMedia"; $bodyobj = ["chat_id" => $chat_id, "message_id" => $message_id, "media" => ["type" => "photo", "media" => $url, "caption" => $caption, "parse_mode" => "Markdown"]]; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $boturl ); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt($ch, CURLOPT_POST, 1 ); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($bodyobj) ); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json')); $result=curl_exec ($ch);
The text was updated successfully, but these errors were encountered:
This should work right out of the box. Will take a look at it once my pc is fixed.
Thanks!
Sorry, something went wrong.
unreal4u
No branches or pull requests
Which version are you using?
3.5.0
Description of problem
EditMessageMedia method doesn't work.
I've tried with this code:
But it always fails with the error: "Bad Request: can't parse InputMedia: Media is not specified".
With the same parameters the classic POST call to telegram api with a JSON body works fine.
The text was updated successfully, but these errors were encountered: