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:
parent
5a94df0b3c
commit
ed954079e4
@ -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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user