1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-11-27 05:34:42 +01:00

Fix reuploading of media files from abstract Media objects

This commit is contained in:
Daniil Gentili 2023-08-29 22:04:13 +02:00
parent 5a94df0b3c
commit ed954079e4
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7

View File

@ -31,6 +31,7 @@ use Amp\Sync\LocalMutex;
use Amp\Sync\Lock;
use danog\MadelineProto\API;
use danog\MadelineProto\BotApiFileId;
use danog\MadelineProto\EventHandler\Media;
use danog\MadelineProto\EventHandler\Message;
use danog\MadelineProto\Exception;
use danog\MadelineProto\FileCallbackInterface;
@ -280,7 +281,7 @@ trait FilesLogic
if (\filter_var($file, FILTER_VALIDATE_URL)) {
return $this->uploadFromUrl($file, 0, $fileName, $cb, $encrypted);
}
} elseif (\is_array($file)) {
} elseif (\is_array($file) || $file instanceof Media) {
return $this->uploadFromTgfile($file, $cb, $encrypted);
}
if ($file instanceof ReadableStream || \is_resource($file)) {