diff --git a/src/danog/MadelineProto/MTProtoTools/PeerHandler.php b/src/danog/MadelineProto/MTProtoTools/PeerHandler.php index eeb5ece8..dc6427d4 100644 --- a/src/danog/MadelineProto/MTProtoTools/PeerHandler.php +++ b/src/danog/MadelineProto/MTProtoTools/PeerHandler.php @@ -234,6 +234,7 @@ trait PeerHandler $res['type'] = $constructor['bot'] ? 'bot' : 'user'; break; case 'chat': + case 'chatForbidden': $res['InputPeer'] = ['_' => 'inputPeerChat', 'chat_id' => $constructor['id']]; $res['Peer'] = ['_' => 'peerChat', 'chat_id' => $constructor['id']]; $res['chat_id'] = $constructor['id']; diff --git a/src/danog/MadelineProto/MTProtoTools/UpdateHandler.php b/src/danog/MadelineProto/MTProtoTools/UpdateHandler.php index e49ca7cf..82eb7d34 100644 --- a/src/danog/MadelineProto/MTProtoTools/UpdateHandler.php +++ b/src/danog/MadelineProto/MTProtoTools/UpdateHandler.php @@ -34,14 +34,26 @@ trait UpdateHandler public function pwr_update_handler($update) { if (isset($update['message']['to_id']) && time() - $this->full_chat_last_updated($update['message']['to_id']) <= 600) { - $full_chat = $this->get_pwr_chat($update['message']['to_id']); - $full_chat['last_update'] = time(); - $this->full_chats[$full_chat['id']] = $full_chat; + try { + $full_chat = $this->get_pwr_chat($update['message']['to_id']); + $full_chat['last_update'] = time(); + $this->full_chats[$full_chat['id']] = $full_chat; + } catch (\danog\MadelineProto\Exception $e) { + \danog\MadelineProto\Logger::log($e->getMessage()); + } catch (\danog\MadelineProto\RPCErrorException $e) { + \danog\MadelineProto\Logger::log($e->getMessage()); + } } if (isset($update['message']['from_id']) && time() - $this->full_chat_last_updated($update['message']['from_id']) <= 600) { - $full_chat = $this->get_pwr_chat($update['message']['from_id']); - $full_chat['last_update'] = time(); - $this->full_chats[$full_chat['id']] = $full_chat; + try { + $full_chat = $this->get_pwr_chat($update['message']['from_id']); + $full_chat['last_update'] = time(); + $this->full_chats[$full_chat['id']] = $full_chat; + } catch (\danog\MadelineProto\Exception $e) { + \danog\MadelineProto\Logger::log($e->getMessage()); + } catch (\danog\MadelineProto\RPCErrorException $e) { + \danog\MadelineProto\Logger::log($e->getMessage()); + } } }