This commit is contained in:
Daniil Gentili 2018-05-25 16:47:53 +02:00
parent 4462f6f0c4
commit ed31f6b093

View File

@ -375,13 +375,13 @@ $sentMessage = $MadelineProto->messages->sendMedia([
]); ]);
$output_file_name = $MadelineProto->download_to_file( $output_file_name = $MadelineProto->download_to_file(
new \danog\MadelineProto\FileCallback(
$sentMessage, $sentMessage,
new \danog\MadelineProto\FileCallback(
'/tmp/myname.mp4'
function ($progress) use ($MadelineProto, $peer) { function ($progress) use ($MadelineProto, $peer) {
$MadelineProto->messages->sendMessage(['peer' => $peer, 'message' => 'Download progress: '.$progress.'%']); $MadelineProto->messages->sendMessage(['peer' => $peer, 'message' => 'Download progress: '.$progress.'%']);
} }
), ),
'/tmp/myname.mp4'
); );
``` ```
@ -426,8 +426,8 @@ $sentMessage = $MadelineProto->messages->sendMedia([
]); ]);
$output_file_name = $MadelineProto->download_to_file( $output_file_name = $MadelineProto->download_to_file(
new MyCallback($sentMessage, $peer, $MadelineProto), $sentMessage,
'/tmp/myname.mp4' new MyCallback('/tmp/myname.mp4', $peer, $MadelineProto)
); );
``` ```