From 8445455e646dd76e28c3aa12dde1ac4b98ff52c7 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Sun, 18 Oct 2020 15:43:30 +0200 Subject: [PATCH] Automatically upload files to @me with uploadMedia --- src/danog/MadelineProto/TL/TL.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/danog/MadelineProto/TL/TL.php b/src/danog/MadelineProto/TL/TL.php index 330f54c3..f60e26db 100644 --- a/src/danog/MadelineProto/TL/TL.php +++ b/src/danog/MadelineProto/TL/TL.php @@ -652,6 +652,10 @@ class TL } elseif (isset($arguments['id'])) { $method = 'photos.updateProfilePhoto'; } + } else if ($method === 'messages.uploadMedia') { + if (!isset($arguments['peer']) && !$this->API->getSelf()['bot']) { + $arguments['peer'] = 'me'; + } } $tl = $this->methods->findByMethod($method); if ($tl === false) {