Skip to content

Commit

Permalink
Possible fix to #164
Browse files Browse the repository at this point in the history
  • Loading branch information
Eleirbag89 committed Oct 14, 2019
1 parent ae64eeb commit 1ccbba6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Telegram.php
Original file line number Diff line number Diff line change
Expand Up @@ -3075,7 +3075,7 @@ public function getUpdates($offset = 0, $limit = 100, $timeout = 0, $update = tr
$content = ['offset' => $offset, 'limit' => $limit, 'timeout' => $timeout];
$this->updates = $this->endpoint('getUpdates', $content);
if ($update) {
if (count($this->updates['result']) >= 1) { //for CLI working.
if (is_array($this->updates['result']) && count($this->updates['result']) >= 1) { //for CLI working.
$last_element_id = $this->updates['result'][count($this->updates['result']) - 1]['update_id'] + 1;
$content = ['offset' => $last_element_id, 'limit' => '1', 'timeout' => $timeout];
$this->endpoint('getUpdates', $content);
Expand Down

0 comments on commit 1ccbba6

Please sign in to comment.