diff --git a/src/danog/MadelineProto/MTProtoTools/PeerHandler.php b/src/danog/MadelineProto/MTProtoTools/PeerHandler.php index 047d5153..eaf26c32 100644 --- a/src/danog/MadelineProto/MTProtoTools/PeerHandler.php +++ b/src/danog/MadelineProto/MTProtoTools/PeerHandler.php @@ -202,7 +202,7 @@ trait PeerHandler } $dbres = json_decode(file_get_contents('https://id.pwrtelegram.xyz/db/getusername?id='.$id), true); if ($dbres['ok']) { - return $this->gen_all('@'.$dbres['username']); + return $this->get_info('@'.$dbres['result']); } throw new \danog\MadelineProto\Exception("Couldn't find peer by provided chat id ".$id); } diff --git a/src/danog/MadelineProto/TL/TL.php b/src/danog/MadelineProto/TL/TL.php index edaf6c70..99edf494 100644 --- a/src/danog/MadelineProto/TL/TL.php +++ b/src/danog/MadelineProto/TL/TL.php @@ -182,6 +182,7 @@ trait TL $auto = false; if (!is_array($object) && in_array($type['type'], ['User', 'InputUser', 'Chat', 'InputChannel', 'Peer', 'InputPeer'])) { + //var_dump($this->get_info($object)); $object = $this->get_info($object)[$type['type']]; } if (!isset($object['_'])) {