Skip to content

Commit

Permalink
Add support for retrieve data in edited messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Grillo committed Sep 19, 2017
1 parent 9ae074d commit fa5ca0c
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion Telegram.php
Expand Up @@ -1454,6 +1454,9 @@ public function Text()
if ($type == self::CHANNEL_POST) {
return @$this->data['channel_post']['text'];
}
if ($type == self::EDITED_MESSAGE) {
return @$this->data['edited_message']['text'];
}

return @$this->data['message']['text'];
}
Expand All @@ -1477,7 +1480,9 @@ public function ChatID()
if ($type == self::CHANNEL_POST) {
return @$this->data['channel_post']['chat']['id'];
}

if ($type == self::EDITED_MESSAGE) {
return @$this->data['edited_message']['chat']['id'];
}
return $this->data['message']['chat']['id'];
}

Expand All @@ -1495,6 +1500,9 @@ public function MessageID()
if ($type == self::CHANNEL_POST) {
return @$this->data['channel_post']['message_id'];
}
if ($type == self::EDITED_MESSAGE) {
return @$this->data['edited_message']['message_id'];
}

return $this->data['message']['message_id'];
}
Expand Down Expand Up @@ -1601,6 +1609,9 @@ public function FirstName()
if ($type == self::CHANNEL_POST) {
return @$this->data['channel_post']['from']['first_name'];
}
if ($type == self::EDITED_MESSAGE) {
return @$this->data['edited_message']['from']['first_name'];
}

return @$this->data['message']['from']['first_name'];
}
Expand All @@ -1615,6 +1626,9 @@ public function LastName()
if ($type == self::CHANNEL_POST) {
return @$this->data['channel_post']['from']['last_name'];
}
if ($type == self::EDITED_MESSAGE) {
return @$this->data['edited_message']['from']['last_name'];
}

return @$this->data['message']['from']['last_name'];
}
Expand All @@ -1629,6 +1643,9 @@ public function Username()
if ($type == self::CHANNEL_POST) {
return @$this->data['channel_post']['from']['username'];
}
if ($type == self::EDITED_MESSAGE) {
return @$this->data['edited_message']['from']['username'];
}

return @$this->data['message']['from']['username'];
}
Expand Down Expand Up @@ -1661,6 +1678,9 @@ public function UserID()
if ($type == self::CHANNEL_POST) {
return $this->data['channel_post']['from']['id'];
}
if ($type == self::EDITED_MESSAGE) {
return @$this->data['edited_message']['from']['id'];
}

return $this->data['message']['from']['id'];
}
Expand Down

0 comments on commit fa5ca0c

Please sign in to comment.