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
Bad Request: can't parse InputMedia: Media is not specified
Hello! Tell me a working example of this function! already tried everything
use Telegram\Bot\Api; use Telegram\Bot\Keyboard\Keyboard; use Telegram\Bot\Laravel\Facades\Telegram; use Telegram\Bot\FileUpload\InputFile; use Telegram\Bot\Objects\InputMedia\InputMedia; use Telegram\Bot\Objects\InputMedia\InputMediaPhoto; public $filename = __DIR__ .'/my-photo.jpg'; public function test(){ $images2 = 'https://cdn.pixabay.com/photo/2017/02/20/19/59/sunset-2083771_960_720.jpg'; $res = $this->telegram->editMessageMedia([ 'chat_id' => $chatid, 'message_id' => 6379, 'media' => [ new InputMedia([ 'type' => 'photo', 'media' => inputfile::create($images2, $this->filename), 'caption' => '123', ]) ] ]); }
what am i doing wrong? v3.1.0
The text was updated successfully, but these errors were encountered:
if you execute the code then everything works
$boturl = "https://api.telegram.org/bot".$this->auth_token."/editMessageMedia"; $bodyobj = ["chat_id" => $chatid, "message_id" => $message_id, "media" => ["type" => "photo", "media" => $images1, "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);
but it doesn’t work like that, writes
Telegram \ Bot \ Exceptions \ TelegramResponseException (400) Bad Request: can't parse InputMedia: Media is not specified Previous exceptions Bad Request: can't parse InputMedia: Media is not specified (400)
Telegram \ Bot \ Exceptions \ TelegramResponseException (400) Bad Request: can't parse InputMedia: Media is not specified Previous exceptions
Bad Request: can't parse InputMedia: Media is not specified (400)
$res = $this->telegram->editMessageMedia([ 'chat_id' => $chatid, 'message_id' => 6379, 'media' => ["type" => "photo", "media" => $images2, "caption" => $caption, "parse_mode" => "Markdown"] ]);
Sorry, something went wrong.
No branches or pull requests
Bad Request: can't parse InputMedia: Media is not specified
Hello! Tell me a working example of this function! already tried everything
what am i doing wrong? v3.1.0
The text was updated successfully, but these errors were encountered: