Link Search Menu Expand Document

Method: messages.uploadImportedMedia

Back to methods index

Upload a media file associated with an imported chat, click here for more info ».

Parameters:

NameTypeDescriptionRequired
peerUsername, chat ID, Update, Message or InputPeerThe Telegram chat where the media will be importedOptional
import_idlongIdentifier of a history import session, returned by messages.initHistoryImportYes
file_namestringFile nameYes
mediaMessageMedia, Update, Message or InputMediaMedia metadataOptional

Return type: MessageMedia

Can bots use this method: NO

MadelineProto Example (now async for huge speed and parallelism!):

if (!file_exists('madeline.php')) {
    copy('https://phar.madelineproto.xyz/madeline.php', 'madeline.php');
}
include 'madeline.php';

$MadelineProto = new \danog\MadelineProto\API('session.madeline');
$MadelineProto->start();

// PHP 8+ syntax, use an array on PHP 7.
$MessageMedia = $MadelineProto->messages->uploadImportedMedia(peer: InputPeer, import_id: long, file_name: 'string', media: InputMedia, );