We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 42c5ef2 commit ca3e4b1Copy full SHA for ca3e4b1
examples/echobot-webhook.php
@@ -8,8 +8,7 @@
8
9
$update = $bot->updates();
10
11
-if($update->ok ?? false){
12
- $update = $update->result;
+if(isset($update->update_id)){
13
14
if(isset($update->message)){
15
$bot->copyMessage([
src/Telegram/Updates.php
@@ -10,7 +10,13 @@ class Updates{
public function __construct(?object $data){
if($data !== NULL){
- $this->lastUpdateID = end($data->result)->update_id ?? null;
+
+ if(isset($data->result))
+ $this->lastUpdateID = end($data->result ?? [])->update_id ?? null;
16
+ else
17
+ $this->lastUpdateID = null;
18
19
20
foreach($data as $key => $value)
21
$this->$key = $value;
22
}
0 commit comments