diff --git a/docs/source/pyrogram/Client.rst b/docs/source/pyrogram/Client.rst index b626e745..806950a8 100644 --- a/docs/source/pyrogram/Client.rst +++ b/docs/source/pyrogram/Client.rst @@ -35,7 +35,6 @@ Client send_chat_action send_sticker download_media - download_photo get_user_profile_photos edit_message_text edit_message_caption diff --git a/pyrogram/client/client.py b/pyrogram/client/client.py index cb3c30d6..2e43ac9f 100644 --- a/pyrogram/client/client.py +++ b/pyrogram/client/client.py @@ -3099,49 +3099,6 @@ class Client: return path[0] - def download_photo(self, - photo: types.Photo or types.UserProfilePhoto or types.ChatPhoto, - file_name: str = "", - block: bool = True): - """Use this method to download a photo not contained inside a Message. - For example, a photo of a User or a Chat/Channel. - - Args: - photo (:obj:`Photo ` | :obj:`UserProfilePhoto ` | :obj:`ChatPhoto `): - The photo object. - - file_name (``str``, optional): - A custom *file_name* to be used instead of the one provided by Telegram. - By default, all photos are downloaded in the *downloads* folder in your working directory. - You can also specify a path for downloading photos in a custom location: paths that end with "/" - are considered directories. All non-existent folders will be created automatically. - - block (``bool``, optional): - Blocks the code execution until the photo has been downloaded. - Defaults to True. - - Returns: - On success, the absolute path of the downloaded photo as string is returned, None otherwise. - - Raises: - :class:`Error ` - """ - if isinstance(photo, (types.UserProfilePhoto, types.ChatPhoto)): - photo = types.Photo( - id=0, - access_hash=0, - date=int(time.time()), - sizes=[types.PhotoSize( - type="", - location=photo.photo_big, - w=0, - h=0, - size=0 - )] - ) - - return self.download_media(photo, file_name, block) - def add_contacts(self, contacts: list): """Use this method to add contacts to your Telegram address book.