Skip to content

Commit 35d4e96

Browse files
committed
participant retrocompatibility
1 parent da1f79d commit 35d4e96

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

src/Commands/AdminCommands/WhoisCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function execute()
7070
true, //Select supergroups (super group chat)
7171
true, //Select users (single chat)
7272
null, //'yyyy-mm-dd hh:mm:ss' date range from
73-
null, //'yyyy-mm-dd hh:mm:ss' date range to
73+
null, //'yyyy-mm-dd hh:mm:ss' date range to
7474
$user_id //Specific chat_id to select
7575
);
7676

src/Entities/Message.php

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -190,16 +190,13 @@ 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';
193+
//retrocompatibility
194+
if (isset($data['new_chat_participant'])) {
195+
$data['new_chat_member'] = $data['new_chat_participant'];
197196
}
198197

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';
198+
if (isset($data['left_chat_participant'])) {
199+
$data['left_chat_member'] = $data['left_chat_participant'];
203200
}
204201

205202
$this->new_chat_member = isset($data['new_chat_member']) ? $data['new_chat_member'] : null;

0 commit comments

Comments
 (0)