Fix upload restriction
This commit is contained in:
parent
8ba10b047e
commit
acd66a8bc4
@ -20,6 +20,7 @@
|
||||
*/
|
||||
|
||||
use danog\MadelineProto\Logger;
|
||||
use League\Uri\Contracts\UriException;
|
||||
|
||||
/*
|
||||
* Various ways to load MadelineProto
|
||||
@ -141,7 +142,7 @@ class EventHandler extends \danog\MadelineProto\EventHandler
|
||||
yield $this->messages->deleteMessages(['revoke' => true, 'id' => [$id]]);
|
||||
}
|
||||
} catch (\Throwable $e) {
|
||||
if (\strpos($e->getMessage(), 'Could not connect to URI') === false) {
|
||||
if (\strpos($e->getMessage(), 'Could not connect to URI') === false && !($e instanceof UriException)) {
|
||||
$this->report((string) $e);
|
||||
$this->logger((string) $e, \danog\MadelineProto\Logger::FATAL_ERROR);
|
||||
}
|
||||
|
@ -70,7 +70,8 @@ trait Files
|
||||
}
|
||||
} elseif (\is_array($file)) {
|
||||
return yield $this->uploadFromTgfile($file, $cb, $encrypted);
|
||||
} elseif (!$this->API->settings['upload']['allow_automatic_upload']) {
|
||||
}
|
||||
if (!$this->settings['upload']['allow_automatic_upload']) {
|
||||
return yield $this->uploadFromUrl($file, 0, $fileName, $cb, $encrypted);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user