diff --git a/pyrogram/methods/advanced/save_file.py b/pyrogram/methods/advanced/save_file.py index 49b65097..509eab26 100644 --- a/pyrogram/methods/advanced/save_file.py +++ b/pyrogram/methods/advanced/save_file.py @@ -128,7 +128,10 @@ class SaveFile: if file_size == 0: 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: raise ValueError(f"Can't upload files bigger than {file_size_limit_mib} MiB")