$updates=$MadelineProto->API->get_updates(['offset'=>$offset,'limit'=>50,'timeout'=>0]);// Just like in the bot API, you can specify an offset, a limit and a timeout
foreach($updatesas$update){
$offset=$update['update_id']+1;// Just like in the bot API, the offset must be set to the last update_id
$MadelineProto->messages->sendMessage(['peer'=>$update['update']['message']['from_id'],'message'=>'Downloaded to '.$file.' in '.(time()-$time).' seconds','reply_to_msg_id'=>$update['update']['message']['id'],'entities'=>[['_'=>'messageEntityPre','offset'=>0,'length'=>strlen($res),'language'=>'json',]]]);