Skip to content

Commit ea6fcb7

Browse files
committed
Telegram does not always return 'result', and it does.
1 parent cdbb367 commit ea6fcb7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Telegram.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3087,7 +3087,7 @@ public function getUpdates($offset = 0, $limit = 100, $timeout = 0, $update = tr
30873087
$content = ['offset' => $offset, 'limit' => $limit, 'timeout' => $timeout];
30883088
$this->updates = $this->endpoint('getUpdates', $content);
30893089
if ($update) {
3090-
if (is_array($this->updates['result']) && count($this->updates['result']) >= 1) { //for CLI working.
3090+
if (array_key_exists('result', $this->updates) && is_array($this->updates['result']) && count($this->updates['result']) >= 1) { //for CLI working.
30913091
$last_element_id = $this->updates['result'][count($this->updates['result']) - 1]['update_id'] + 1;
30923092
$content = ['offset' => $last_element_id, 'limit' => '1', 'timeout' => $timeout];
30933093
$this->endpoint('getUpdates', $content);

0 commit comments

Comments
 (0)