Skip to content

Commit fa5ca0c

Browse files
author
Grillo
committed
Add support for retrieve data in edited messages
1 parent 9ae074d commit fa5ca0c

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

Telegram.php

+21-1
Original file line numberDiff line numberDiff line change
@@ -1454,6 +1454,9 @@ public function Text()
14541454
if ($type == self::CHANNEL_POST) {
14551455
return @$this->data['channel_post']['text'];
14561456
}
1457+
if ($type == self::EDITED_MESSAGE) {
1458+
return @$this->data['edited_message']['text'];
1459+
}
14571460

14581461
return @$this->data['message']['text'];
14591462
}
@@ -1477,7 +1480,9 @@ public function ChatID()
14771480
if ($type == self::CHANNEL_POST) {
14781481
return @$this->data['channel_post']['chat']['id'];
14791482
}
1480-
1483+
if ($type == self::EDITED_MESSAGE) {
1484+
return @$this->data['edited_message']['chat']['id'];
1485+
}
14811486
return $this->data['message']['chat']['id'];
14821487
}
14831488

@@ -1495,6 +1500,9 @@ public function MessageID()
14951500
if ($type == self::CHANNEL_POST) {
14961501
return @$this->data['channel_post']['message_id'];
14971502
}
1503+
if ($type == self::EDITED_MESSAGE) {
1504+
return @$this->data['edited_message']['message_id'];
1505+
}
14981506

14991507
return $this->data['message']['message_id'];
15001508
}
@@ -1601,6 +1609,9 @@ public function FirstName()
16011609
if ($type == self::CHANNEL_POST) {
16021610
return @$this->data['channel_post']['from']['first_name'];
16031611
}
1612+
if ($type == self::EDITED_MESSAGE) {
1613+
return @$this->data['edited_message']['from']['first_name'];
1614+
}
16041615

16051616
return @$this->data['message']['from']['first_name'];
16061617
}
@@ -1615,6 +1626,9 @@ public function LastName()
16151626
if ($type == self::CHANNEL_POST) {
16161627
return @$this->data['channel_post']['from']['last_name'];
16171628
}
1629+
if ($type == self::EDITED_MESSAGE) {
1630+
return @$this->data['edited_message']['from']['last_name'];
1631+
}
16181632

16191633
return @$this->data['message']['from']['last_name'];
16201634
}
@@ -1629,6 +1643,9 @@ public function Username()
16291643
if ($type == self::CHANNEL_POST) {
16301644
return @$this->data['channel_post']['from']['username'];
16311645
}
1646+
if ($type == self::EDITED_MESSAGE) {
1647+
return @$this->data['edited_message']['from']['username'];
1648+
}
16321649

16331650
return @$this->data['message']['from']['username'];
16341651
}
@@ -1661,6 +1678,9 @@ public function UserID()
16611678
if ($type == self::CHANNEL_POST) {
16621679
return $this->data['channel_post']['from']['id'];
16631680
}
1681+
if ($type == self::EDITED_MESSAGE) {
1682+
return @$this->data['edited_message']['from']['id'];
1683+
}
16641684

16651685
return $this->data['message']['from']['id'];
16661686
}

0 commit comments

Comments
 (0)