Skip to content

Commit 7eccb0e

Browse files
committed
Telegram does not always return 'result', and it does.
1 parent aa9ba83 commit 7eccb0e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Telegram.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ public function sendDocument(array $content)
507507
public function sendAnimation(array $content)
508508
{
509509
return $this->endpoint('sendAnimation', $content);
510-
}
510+
}
511511

512512
/// Send a sticker
513513

@@ -3075,7 +3075,7 @@ public function getUpdates($offset = 0, $limit = 100, $timeout = 0, $update = tr
30753075
$content = ['offset' => $offset, 'limit' => $limit, 'timeout' => $timeout];
30763076
$this->updates = $this->endpoint('getUpdates', $content);
30773077
if ($update) {
3078-
if (is_array($this->updates['result']) && count($this->updates['result']) >= 1) { //for CLI working.
3078+
if (array_key_exists('result', $this->updates) && is_array($this->updates['result']) && count($this->updates['result']) >= 1) { //for CLI working.
30793079
$last_element_id = $this->updates['result'][count($this->updates['result']) - 1]['update_id'] + 1;
30803080
$content = ['offset' => $last_element_id, 'limit' => '1', 'timeout' => $timeout];
30813081
$this->endpoint('getUpdates', $content);

0 commit comments

Comments
 (0)