Eleirbag89 / TelegramBotPHP

A very simple PHP Telegram Bot API for sending messages.
http://eleirbag89.github.io/TelegramBotPHP
MIT License
800 stars 340 forks source link

unable to editMessageText ! #208

Closed alil0rd closed 4 years ago

alil0rd commented 4 years ago

Hi. I used to edit some message but I failed. here is my code: ``

$content = array('chat_id' => $chat_id, 'text' => " some text ");

$firstMessage= $telegram->sendMessage($content);

$content = array('chat_id' => $chat_id,'message_id'=> $firstMessage['message_id'], 'text' => " some text 2 ");

$telegram->editMessageText($content); `` but it doesnt working!

I also attach the log file :

ok: False error_code: 400 description: Bad Request: message to edit not found

Eleirbag89 commented 4 years ago

You should get the message id this way:

$response = $telegram->sendMessage($content);
    $msg_id=$response['result']['message_id'];