Method: messages.uploadMedia
Upload a file and associate it to a chat (without actually sending it to the chat)
Parameters:
Name | Type | Description | Required |
---|---|---|---|
business_connection_id | string | Optional | |
peer | Username, chat ID, Update, Message or InputPeer | The chat, can be inputPeerEmpty for bots and inputPeerSelf for users. | Optional |
media | MessageMedia, Update, Message or InputMedia | File uploaded in chunks as described in files » | Optional |
Return type: MessageMedia
Can bots use this method: YES
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();
$MessageMedia = $MadelineProto->messages->uploadMedia(business_connection_id: 'string', peer: $InputPeer, media: $InputMedia, );