Skip to content

Commit fd7085f

Browse files
committed
Fix potential fatal error
1 parent 93ce83b commit fd7085f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Telegram/Bot.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function isValidToken(bool $thoroughCheck): bool
6464
}
6565

6666
try {
67-
return $this->getMe()->getBody()->ok;
67+
return $this->getMe()->body->ok;
6868
} catch (TelegramException $e) {
6969
return false;
7070
}
@@ -141,7 +141,7 @@ public function updates(?int $offset = null): ?Update
141141
if ($this->updatesMethod === Update::UPDATES_FROM_GET_UPDATES) {
142142
return new Update($this->getUpdates([
143143
"offset" => isset($offset) ? $offset + 1 : null
144-
])->getBody(), $this->updatesMethod);
144+
])->body, $this->updatesMethod);
145145
}
146146

147147
if ($this->updatesMethod === Update::UPDATES_FROM_WEBHOOK) {

0 commit comments

Comments
 (0)