PHP
0
Вклад в тег
$dialogs = $MadelineProto->get_dialogs();
$channels = [];
foreach ($dialogs as $a => $b) {
if (isset($b['channel_id'])) {
$channels[] = "-100{$b['channel_id']}";
}
}
$settings = [
"peer" => "",
"offset_id" => "0",
"offset_date" => "0",
"add_offset" => "0",
"limit" => "5",
"max_id" => "0",
"min_id" => "0",
"hash" => "0",
];
$messages = [];
foreach ($channels as $a) {
$settings['peer'] = $a;
$messages[] = $MadelineProto->messages->getHistory($settings);
}
foreach ($messages as $m) {
foreach ($m['messages'] as $n) {
if (isset($n['media']['photo'])) {
$MessageMedia = $n['media']['photo'];
$output_file_name = $MadelineProto->download_to_dir($MessageMedia, 'tmp');
echo $output_file_name;
}
}
}