Skip to content

Commit 68fe510

Browse files
committed
Fixed default updates' methods
1 parent a90a65f commit 68fe510

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Telegram/Update.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public function getLastUpdateId(): ?int
102102
*/
103103
public function getMessage(): ?object
104104
{
105-
if(!isset($customs['message'])) {
105+
if(!isset($this->customs['message'])) {
106106
$this->customs['message'] = $this->data->message ??
107107
$this->data->edited_message ??
108108
$this->data->channel_post ??
@@ -121,8 +121,8 @@ public function getMessage(): ?object
121121
*/
122122
public function getChat(): ?object
123123
{
124-
if(!isset($customs['chat'])) {
125-
$this->customs['chat'] = $this->customs['chat']->chat ??
124+
if(!isset($this->customs['chat'])) {
125+
$this->customs['chat'] = $this->getMessage()->chat ??
126126
$this->data->callback_query->message->chat ??
127127
$this->data->my_chat_member->chat ??
128128
$this->data->chat_member->chat ??
@@ -140,10 +140,10 @@ public function getChat(): ?object
140140
*/
141141
public function getUser(): ?object
142142
{
143-
if(!isset($customs['user'])) {
143+
if(!isset($this->customs['user'])) {
144144
$this->customs['user'] = $this->data->callback_query->from ??
145-
$this->customs['user']->from ??
146-
$this->customs['user']->sender_chat ??
145+
$this->getChat()->from ??
146+
$this->getChat()->sender_chat ??
147147
$this->data->inline_query->from ??
148148
$this->data->chosen_inline_result->from ??
149149
$this->data->callback_query->from ??

0 commit comments

Comments
 (0)