Skip to content

Commit b44ff53

Browse files
committed
restore getNewChatParticipant() getLeftChatParticipant() for compatiblity purposes, new_chat_participant and left_chat_participant = new_chat_member and left_chat_member
1 parent 3da71cd commit b44ff53

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/Entities/Message.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,18 @@ protected function init(array & $data, & $bot_name)
190190
$this->type = 'Venue';
191191
}
192192

193+
$this->new_chat_member = isset($data['new_chat_participant']) ? $data['new_chat_participant'] : null;
194+
if (!empty($this->new_chat_member)) {
195+
$this->new_chat_member = new User($this->new_chat_member);
196+
$this->type = 'new_chat_member';
197+
}
198+
199+
$this->left_chat_member = isset($data['left_chat_participant']) ? $data['left_chat_participant'] : null;
200+
if (!empty($this->left_chat_member)) {
201+
$this->left_chat_member = new User($this->left_chat_member);
202+
$this->type = 'left_chat_member';
203+
}
204+
193205
$this->new_chat_member = isset($data['new_chat_member']) ? $data['new_chat_member'] : null;
194206
if (!empty($this->new_chat_member)) {
195207
$this->new_chat_member = new User($this->new_chat_member);
@@ -407,6 +419,16 @@ public function getVenue()
407419
return $this->venue;
408420
}
409421

422+
public function getNewChatParticipant()
423+
{
424+
return $this->new_chat_member;
425+
}
426+
427+
public function getLeftChatParticipant()
428+
{
429+
return $this->left_chat_member;
430+
}
431+
410432
public function getNewChatMember()
411433
{
412434
return $this->new_chat_member;

0 commit comments

Comments
 (0)