Telegram Botman – getBotMessages not working

  botman, bots, laravel, telegram, telegram-bot

Hi i need the last message id that send with bot
and i want to get last message bot in conversation
$this->bot->getBotMessages();
when i print that on serialize
$this->bot->reply($this->bot->getBotMessages());
to then get id with this way
getPayload()['message_id']
return this
a:0:{}

i want this for reply to the last bot message

this is my code


    $text = "Hello world";

    $parameters = [
        'chat_id' => $this->bot->getBotMessages()[0]->getPayload()['chat']['id'],
        'reply_to_message_id' => $this->bot->getBotMessages()[0]->getPayload()['message_id'],
        'text' => $text
    ];
    $this->bot->sendRequest('sendMessage',$parameters);

Source: Laravel

Leave a Reply