Automatically upload files to @me with uploadMedia

This commit is contained in:
Daniil Gentili 2020-10-18 15:43:30 +02:00
parent ad85b0a6c0
commit 8445455e64
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7

View File

@ -652,6 +652,10 @@ class TL
} elseif (isset($arguments['id'])) { } elseif (isset($arguments['id'])) {
$method = 'photos.updateProfilePhoto'; $method = 'photos.updateProfilePhoto';
} }
} else if ($method === 'messages.uploadMedia') {
if (!isset($arguments['peer']) && !$this->API->getSelf()['bot']) {
$arguments['peer'] = 'me';
}
} }
$tl = $this->methods->findByMethod($method); $tl = $this->methods->findByMethod($method);
if ($tl === false) { if ($tl === false) {