public function getUpdates($offset = 0, $limit = 100, $timeout = 0)
    {
        $updates = ArrayOfUpdates::fromResponse($this->call('getUpdates', [
            'offset' => $offset,
            'limit' => $limit,
            'timeout' => $timeout,
        ]));

        if ($this->tracker instanceof Botan) {
            foreach ($updates as $update) {
                $this->trackUpdate($update);
            }
        }

        return $updates;
    }
public function getUpdates($offset = 0, $limit = 100, $timeout = 0)
    {
        $updates = ArrayOfUpdates::fromResponse($this->call('getUpdates', [
            'offset' => $offset,
            'limit' => $limit,
            'timeout' => $timeout,
        ]));

        if ($this->tracker instanceof Botan) {
            foreach ($updates as $update) {
                $this->trackUpdate($update);
            }
        }

        return $updates;
    }
public function getUpdates ( $ offset = 0 , $ limit = 100 , $ timeout = 0 ) { $ updates = ArrayOfUpdates :: fromResponse ( $ this -> call ( 'getUpdates' , [ 'offset' => $ offset , 'limit' => $ limit , 'timeout' => $ timeout , ] ) ) ; if ( $ this -> tracker instanceof Botan ) { foreach ( $ updates as $ update ) { $ this -> trackUpdate ( $ update ) ; } } return $ updates ; }
Use this method to receive incoming updates using long polling.
An Array of Update objects is returned.

Notes
1. This method will not work if an outgoing webhook is set up.
2. In order to avoid getting duplicate updates, recalculate offset after each server response.

@param int $offset
@param int $limit
@param int $timeout

@return Update[]
@throws \TelegramBot\Api\Exception
@throws \TelegramBot\Api\InvalidArgumentException
Use this method to receive incoming updates using long polling . An Array of Update objects is returned .