mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-12-02 10:41:19 +00:00
Fix save_file in case client.me is None
This commit is contained in:
parent
1d92c09d44
commit
00d1b532b8
@ -128,7 +128,10 @@ class SaveFile:
|
|||||||
if file_size == 0:
|
if file_size == 0:
|
||||||
raise ValueError("File size equals to 0 B")
|
raise ValueError("File size equals to 0 B")
|
||||||
|
|
||||||
file_size_limit_mib = 4000 if self.me.is_premium else 2000
|
if self.me and self.me.is_premium:
|
||||||
|
file_size_limit_mib = 4000
|
||||||
|
else:
|
||||||
|
file_size_limit_mib = 2000
|
||||||
|
|
||||||
if file_size > file_size_limit_mib * 1024 * 1024:
|
if file_size > file_size_limit_mib * 1024 * 1024:
|
||||||
raise ValueError(f"Can't upload files bigger than {file_size_limit_mib} MiB")
|
raise ValueError(f"Can't upload files bigger than {file_size_limit_mib} MiB")
|
||||||
|
Loading…
Reference in New Issue
Block a user